Exemplo n.º 1
0
 public function actionChangeOrder()
 {
     $ID = Yii::app()->request->getParam('order');
     if ($_POST['idArr'] && isset($_POST['amountArr']) && $_POST['ID'] && $_POST['payment']) {
         $res = OrderService::changeOrder($_POST);
         echo json_encode($res);
         exit;
     }
     $cond = "((t.Payment=1 and t.Status=1 and ISNULL(t.AlipayTN)) or (t.Payment=2 and t.Status=2))";
     $criteria = new CDbCriteria();
     $organID = Yii::app()->user->getOrganID();
     $criteria->condition = "t.BuyerID={$organID} and t.IsDelete=0 and {$cond}";
     $model = PapOrder::model()->findByPk($ID, $criteria);
     if (!$model) {
         $this->redirect(array('index'));
     }
     foreach ($model->goodsinfo as $v) {
         $v = self::getVersionGoods($v);
     }
     //var_dump($model);die;
     $this->pageTitle = Yii::app()->name . ' - ' . "修改订单";
     $this->render('changeorder', array('data' => $model));
 }