public function del()
 {
     $id = I('break_id');
     $applianceTroubleLogic = new l\ApplianceTroubleLogic();
     $result = $applianceTroubleLogic->delTrouble($id);
     S('troubles', NULL);
     $data['message'] = $result['message'];
     $this->ajaxReturn($data, 'JSON');
 }
Пример #2
0
 /**
  * 从缓存中读取故障数据   
  * @return array
  */
 public function getAllTroubles()
 {
     //电器品类初始化
     S('troubles', null);
     if (!S('troubles')) {
         $applianceTroubleLogic = new l\ApplianceTroubleLogic();
         $troubleData = $applianceTroubleLogic->getTroubleList($condition, $page, $limit);
         $trouble_list = $salesData['datas'];
         $count = count($trouble_list);
         for ($i = 0; $i < $count; $i++) {
             $applianceName = $trouble_list[$i]['f_name'];
             $troubleMap[$applianceName]['break_name'] = $trouble_list[$i]['break_name'];
             $troubleMap[$applianceName]['break_id'] = $trouble_list[$i]['break_id'];
         }
         S('troubles', $troubleMap);
     }
     return S('troubles');
 }