예제 #1
0
 /**
  * 开始处理属性初始化
  *
  * @Author   tianyunzi
  * @DateTime 2016-02-17T09:02:54+0800
  * @return   [type]                   [description]
  */
 public function runAction()
 {
     $fp = fopen("/tmp/b", "r");
     while (!feof($fp)) {
         $line = trim(fgets($fp));
         if (empty($line)) {
             continue;
         }
         $propertyArr = explode("\t", $line);
         $propertyArr[1] = json_decode($propertyArr[1], true);
         /** 如果某一行没有入表成功,输出下内容测试下 */
         $cateid = $propertyArr[0];
         $count = Fbcateproperty::count("cateid='" . $cateid . "'");
         if ($count > 0) {
             continue;
         }
         // echo $cateid . "\n";
         // var_dump($propertyArr[1]);
         // exit;
         $this->solveCateProperty($propertyArr[0], $propertyArr[1]);
     }
     echo "country类型属性 " . $this->country . "\n";
     echo "model_numbers类型属性 " . $this->model_numbers . "\n";
     echo "intervall类型属性 " . $this->interval . "\n";
     echo "group_table类型属性 " . $this->group_table . "\n";
 }
예제 #2
0
 public function checkHasProperty($cateid)
 {
     $this->total++;
     $count = Fbcateproperty::count("cateid = '" . $cateid . "'");
     if ($count > 0) {
         return true;
     }
     return false;
 }