public function addView()
 {
     $initialLogic = new l\InitialLogic();
     $applianceList = $initialLogic->getAllAppliances();
     $applianceFather = $applianceList['father'];
     $applianceChildMap = json_encode($applianceList['child']);
     $this->assign('applianceFather', $applianceFather);
     $this->assign('applianceChildMap', $applianceChildMap);
     $this->display();
 }
Example #2
0
 public function index()
 {
     // 获取顶部可访问菜单
     $initialLogic = new l\InitialLogic();
     $left_menu = $initialLogic->getLeftMenus();
     /**************
        $menu_logic = new l\MenuLogic();
        $left_menu = $menu_logic->getAccessibleLeftMenu();
        foreach($left_menu as &$lm){
           $lm['child_menu']=$menu_logic->getAccessibleLeftChildMenu($lm['id']);
        }
        *********/
     $top_menu[0] = array("class" => "fa fa-tasks", "ul" => "dropdown-menu extended tasks-bar", "number" => "4");
     $top_menu[1] = array("class" => "fa fa-envelope-o", "ul" => "dropdown-menu extended inbox", "number" => "5");
     $role = model('Role')->find(session('user_info.role'));
     //$role = model('Role')->find(session('user_info.role_id'));
     //$_SESSION['user_info']['name'] = $role['name'];
     $this->assign('top_menu', $top_menu);
     $this->assign('left_menu', $left_menu);
     $this->assign('user_info', session('user_info'));
     $this->display();
 }
Example #3
0
 public function add()
 {
     $initialLogic = new l\InitialLogic();
     $brandList = $initialLogic->getAllBrands();
     $salesList = $initialLogic->getAllSales();
     $brandName = I('brandName');
     $brandID = $brandList['Map'][$brandName];
     $salesName = I('salesName');
     $salesID = $salesList['Map'][$salesName];
     $break_pic = $_FILES['break_pics'];
     $bill_pic = $_FILES['billphoto'];
     $break_pics = null;
     $invoice_pic = null;
     if ($break_pic != '' && $break_pic != null) {
         $break_photo_name = "order/pic/breakphoto/" . uniqid() . strrchr($break_pic['name'], 46);
         $filepath = UploadBeforeOss($break_pic);
         $break_pics = C('OSS_FILE_PREFIX') . '/' . $break_photo_name;
         if (!ImgOssUpload($break_photo_name, $filepath)) {
             $data['status'] = 300;
             $data['message'] = '图片上传失败';
             $data['error_code'] = 10002;
             $this->ajaxReturn($data, 'JSON');
         }
     }
     if ($bill_pic != '' && $bill_pic != null) {
         $bill_photo_name = "order/pic/billphoto/" . uniqid() . strrchr($bill_pic['name'], 46);
         $filepath = UploadBeforeOss($bill_pic);
         $invoice_pic = C('OSS_FILE_PREFIX') . '/' . $bill_photo_name;
         if (!ImgOssUpload($bill_photo_name, $filepath)) {
             $data['status'] = 300;
             $data['message'] = '图片上传失败';
             $data['error_code'] = 10002;
             $this->ajaxReturn($data, 'JSON');
         }
     }
     $order['send_type'] = I('order_type');
     $order['appliance_id'] = I('appliance-father');
     $order['uappliance_id'] = I('appliance');
     $order['brand_id'] = $brandID;
     $order['servicetime'] = I('servicetime');
     $order['phone'] = I('customerPhone');
     $order['user_name'] = I('customerName');
     $order['address'] = I('prov') . "-" . I('city') . "-" . I('dist') . "-" . I('address') . "-" . I('doorNumber');
     $order['is_auto'] = I('pushMethod');
     $order['mer_only_code'] = I('merchant_code');
     $order['buy_time'] = I('buytime');
     $order['invoice'] = I('billNumber');
     $order['buy_mer_id'] = $salesID;
     $order['break_describe'] = I('break_describe');
     $order['invoice_pic'] = $invoice_pic;
     $order['break_pics'] = $break_pics;
     //$logdata = json_encode($order);
     //addErrorLog("Order","add","address",$logdata);
     $orderLogic = new l\OrderLogic();
     $result = $orderLogic->addOrder($order);
     $data['success'] = true;
     $data['status'] = $result['status'];
     $data['message'] = $result['message'];
     $this->ajaxReturn($data, 'JSON');
 }
Example #4
0
 /**
  * 添加订单时获取品牌授权商户  
  * @return array
  */
 public function listBrandMerchant()
 {
     $brand_name = I('brand_name');
     $initialLogic = new l\InitialLogic();
     $brandList = $initialLogic->getAllBrands();
     $merchant['brand_id'] = $brandList['Map'][$brand_name];
     $merchantLogic = new l\MerchantLogic();
     //API 获取商户数据
     $merchant_data = $merchantLogic->getMerchantList($merchant, null, 0);
     $merchant_list = $merchant_data['datas'];
     //addErrorLog('appliance','loginc','current',$current);
     $this->assign('brandName', $brand_name);
     $this->assign('merchant_list', $merchant_list);
     $this->display();
 }