コード例 #1
0
 public function actionUpdateProductTaste()
 {
     $tasteArr = array();
     $lid = Yii::app()->request->getParam('lid');
     Until::isUpdateValid(array($lid), $this->companyId, $this);
     //0,表示企业任何时候都在云端更新。
     $model = Product::model()->find('lid=:lid and dpid=:dpid', array(':lid' => $lid, ':dpid' => $this->companyId));
     if (Yii::app()->request->isPostRequest) {
         $postData = Yii::app()->request->getPost('Taste');
         if (TasteClass::saveProductTaste($this->companyId, $lid, $postData)) {
             Yii::app()->user->setFlash('success', yii::t('app', '修改成功'));
             $this->redirect(array('taste/productTaste', 'companyId' => $this->companyId));
         }
     }
     $tastes = TasteClass::getAllOrderTasteGroup($this->companyId, 0);
     $productTastes = TasteClass::getProductTasteGroup($lid, $this->companyId);
     foreach ($productTastes as $taste) {
         array_push($tasteArr, $taste['lid']);
     }
     $this->render('updateProductTaste', array('model' => $model, 'tastes' => $tastes, 'productTastes' => $tasteArr));
 }
コード例 #2
0
 public function actionProductTasteAll()
 {
     $lid = Yii::app()->request->getParam('lid', 0);
     $companyId = Yii::app()->request->getParam('companyId');
     $isall = Yii::app()->request->getParam('isall', '0');
     if ($isall == '1') {
         $tastegroups = TasteClass::getAllOrderTasteGroup($companyId, '1');
         $orderTastes = TasteClass::getOrderTaste($lid, '1', $companyId);
         $tasteMemo = TasteClass::getOrderTasteMemo($lid, '1', $companyId);
         $orderId = $lid;
     } else {
         $tastegroups = TasteClass::getProductTasteGroup($lid, $companyId);
         $orderTastes = TasteClass::getOrderTaste($lid, '2', $companyId);
         $tasteMemo = TasteClass::getOrderTasteMemo($lid, '2', $companyId);
     }
     $this->renderPartial('tastedetailall', array('tastegroups' => $tastegroups, 'orderTastes' => $orderTastes, 'tasteMemo' => $tasteMemo));
 }