コード例 #1
0
ファイル: SellerorderController.php プロジェクト: zwq/unpei
 public function actionEditSendOrder()
 {
     $ID = Yii::app()->request->getParam('order');
     if ($_POST['ID'] && $_POST['ShipLogis']) {
         $res = SellerorderService::editSendOrder($_POST);
         echo json_encode($res);
         exit;
     }
     $cond = "t.Status=3 and t.ReturnStatus=0";
     // and (ISNULL(t.ShipSn) or t.ShipSn='')
     $data = SellerorderService::getOrderDetail($ID, $cond);
     if (!$data) {
         $this->redirect(array('index'));
     }
     $logCompany = Logistics::model()->findAll();
     $this->pageTitle = Yii::app()->name . ' - ' . "订单发货编辑";
     $this->render('sendedit', array('data' => $data, 'ID' => $ID, 'logCompany' => $logCompany));
 }
コード例 #2
0
ファイル: LogisticsController.php プロジェクト: zwq/unpei
 public function actionUpdatelogistics()
 {
     $id = trim($_GET['ID']);
     $organID = Commonmodel::getOrganID();
     $model = Logistics::model()->findByPk($id);
     if (isset($_POST)) {
         $attributes['LogisticsDescription'] = $_POST['LogisticsDescription'];
         $model->attributes = $attributes;
         $model->LogisticsCompany = $_POST['LogisticsCompany'];
         $model->OrganID = $organID;
         $model->CreateTime = time();
         $model->UpdateTime = time();
         $model->Status = 2;
         //状态为2是经销商物流
         $bool = $model->save();
         if ($bool) {
             // 把地址添加到关系表里,可添加多个
             $sprovince = $_POST['province'];
             $scity = $_POST['city'];
             $sarea = $_POST['area'];
             $addlegth = count($sprovince);
             for ($i = 0; $i < $addlegth; $i++) {
                 $model1 = new LogisticsAddress();
                 $model1->LogisticsID = $id;
                 $model1->Province = $sprovince[$i];
                 $model1->City = $scity[$i];
                 $model1->Area = $sarea[$i];
                 $model1->save();
             }
         }
         if ($bool) {
             $rs = array('success' => 1, 'errorMsg' => '物流公司修改成功');
         } else {
             $rs = array('success' => 0, 'errorMsg' => '物流公司修改失败');
         }
     }
     echo json_encode($rs);
 }
コード例 #3
0
ファイル: LogisticsService.php プロジェクト: zwq/unpei
 public static function delwuliu($logid)
 {
     $res = JpdLogisticsArea::model()->deleteAll('LogID=' . $logid);
     $count = Logistics::model()->deleteByPk($logid);
     echo json_encode(array('count' => $count + $res));
 }