Exemplo n.º 1
0
 public static function branddateget()
 {
     $rowsPer = 500;
     $data = Yii::app()->beudb->createCommand()->select('*')->from('b_brand')->queryAll();
     if (count($data) > 0) {
         $data = Comm::Conversion($data, "GBK", "UTF-8");
         foreach ($data as $value) {
             $arr = array();
             $arr['id'] = $value['id'];
             $arr['name'] = $value['name'];
             if (empty($value['englishname'])) {
                 $arr['englishname'] = $value['name'];
             } else {
                 $arr['englishname'] = $value['englishname'];
             }
             $arr['logoimgpath'] = $value['logoimgpath'];
             $arr['telephone'] = $value['telephone'];
             $arr['address'] = $value['address'];
             //				echo $value['clothescategory'];exit();
             $arr['fax'] = $value['fax'];
             $arr['website'] = $value['website'];
             $arr['companyname'] = $value['companyname'];
             if ($value['status'] == 1) {
                 $arr['status'] = 10;
             } else {
                 $arr['status'] = 11;
             }
             $arr['createdate'] = $value['date_added'];
             try {
                 Brand::brandSelectById($value['id']);
             } catch (Exception $e) {
                 Brand::brandForAdd($arr);
             }
         }
     } else {
         echo "null";
     }
 }