예제 #1
0
 /**
  * 开始处理数据
  *
  * @Author   tianyunzi
  * @DateTime 2016-02-24T09:45:44+0800
  * @return   [type]                   [description]
  */
 public function runAction()
 {
     $cateid = 0;
     while (1) {
         $cateMysql = Fbcateinfo::find(array("conditions" => "cateid > ?1", "bind" => array(1 => $cateid), "order" => "cateid asc", "limit" => 100));
         $cateArr = $cateMysql->toArray();
         if (empty($cateArr)) {
             break;
         }
         foreach ($cateArr as $value) {
             $cateid = $value["cateid"];
             $this->checkCatezh($cateid);
         }
     }
 }
예제 #2
0
 /**
  * 分析下所有的新增的分类是否和属性对应,因为新增分类id是自增的,所以可能id对应的不正确
  *
  * @Author   tianyunzi
  * @DateTime 2016-02-18T10:28:38+0800
  * @return   [type]                   [description]
  */
 public function cateaddAction()
 {
     $id = 0;
     while (1) {
         $cateMysql = Fbcateinfo::find(array("conditions" => "cateid > ?1 and is_copyadd = 1", "bind" => array(1 => $id), "limit" => 100));
         $cateRs = $cateMysql->toArray();
         if (empty($cateRs)) {
             break;
         }
         foreach ($cateRs as $value) {
             $id = $value["cateid"];
             $propertyRs = Fbcateproperty::find(array("conditions" => "cateid = ?1", "bind" => array(1 => $id), "limit" => 100));
             $propertyRs = $propertyRs->toArray();
             if (empty($propertyRs)) {
                 continue;
             }
             echo $value["catename"] . "\n";
             foreach ($propertyRs as $value1) {
                 echo "====  " . $value1["ppname"] . "  ======\n";
             }
         }
     }
 }