Exemplo n.º 1
0
 /**
  * 获取电器品类列表
  * @param int $fl_id 父类ID
  * @param int $page 分页页数
  * @param int $limit 每页显示的条数         
  * @return array
  */
 public function index()
 {
     $page = I('page');
     $fl_id = I('fl_id');
     $limit = 10;
     $map['skill'] = I('skill');
     $map['province'] = I('province');
     $map['city'] = I('city');
     $map['campus'] = I('campus');
     $map['address'] = I('address');
     $map['company_name'] = I('company_name');
     $map['herader_phone'] = I('herader_phone');
     $map['brands'] = I('brands');
     $companyLogic = new l\CompanyLogic();
     $applianceLogic = new l\ApplianceLogic();
     $companyData = $companyLogic->getCompanyList($fl_id, $page, $limit, $map);
     $father_list = $applianceLogic->getApplianceFatherList();
     $appliance_list = $applianceData['datas'];
     $current = $applianceData['current'];
     $list_count = $applianceData['allcount'];
     $pages = ceil($list_count / $limit);
     //addErrorLog('appliance','loginc','current',$current);
     $this->assign('pages', $pages);
     $this->assign('list_count', $list_count);
     $this->assign('current', $current);
     $this->assign('appliance_list', $appliance_list);
     $this->assign('father_list', $father_list);
     $this->display();
 }
Exemplo n.º 2
0
 /**
  * 从缓存中读取品类数据   
  * @return array
  */
 public function getAllAppliances()
 {
     //电器品类初始化
     S('appliances', null);
     if (!S('appliances')) {
         $applianceLogic = new l\ApplianceLogic();
         $applianceFatherList = $applianceLogic->getApplianceFatherList();
         foreach ($applianceFatherList as $father) {
             $fatherId = $father['appliance_id'];
             $child = $applianceLogic->getApplianceSonList($fatherId);
             //addErrorLog("initial","initiallogic","eachchild",$child);
             $childMap[$fatherId] = $child;
         }
         $applianceMap['father'] = $applianceFatherList;
         $applianceMap['child'] = $childMap;
         //addErrorLog("initial","initiallogic","allchild",$childMap['43']);
         S('appliances', $applianceMap);
     }
     return S('appliances');
 }
Exemplo n.º 3
0
 /**
  * 获取电器品类列表
  * @param int $fid 品类ID
  * @param int $page 分页页数
  * @param String $brand_name 品牌名称
  * @param int $limit 每页显示的条数         
  * @return array
  */
 public function index()
 {
     $page = I('page');
     $applianceId = I('fid');
     $brandName = I('brand_name');
     $limit = 10;
     $brandLogic = new l\BrandLogic();
     $applianceLogic = new l\ApplianceLogic();
     $brandData = $brandLogic->getBrandList($applianceId, $brandName, $page, $limit);
     $father_list = $applianceLogic->getApplianceFatherList();
     $brand_list = $brandData['datas'];
     $current = $brandData['current'];
     $list_count = $brandData['allcount'];
     $pages = ceil($list_count / $limit);
     //addErrorLog('appliance','loginc','current',$current);
     $data['error_code'] = $brandLogic->getErrorCode();
     $data['error_message'] = $brandLogic->getErrorMessage();
     $this->assign('pages', $pages);
     $this->assign('list_count', $list_count);
     $this->assign('current', $current);
     $this->assign('brand_list', $brand_list);
     $this->assign('father_list', $father_list);
     $this->display();
 }
Exemplo n.º 4
0
 public function del()
 {
     $id = I('appliance_id');
     $applianceLogic = new l\ApplianceLogic();
     $result = $applianceLogic->delAppliance($id);
     S('appliances', NULL);
     $data['message'] = $result['message'];
     $this->ajaxReturn($data, 'JSON');
 }