public function actionProductTaste()
 {
     $lid = Yii::app()->request->getParam('lid', 0);
     $typeId = Yii::app()->request->getParam('typeId');
     $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;
         //var_dump($tastegroups,$orderTastes,$tasteMemo);exit;
     } else {
         $orderProduct = OrderProduct::model()->find(' lid=:lid and dpid=:dpid', array(':lid' => $lid, ':dpid' => $companyId));
         $tastegroups = TasteClass::getProductTasteGroup($orderProduct->product_id, $companyId);
         $orderTastes = TasteClass::getOrderTaste($lid, '2', $companyId);
         $tasteMemo = TasteClass::getOrderTasteMemo($lid, '2', $companyId);
         $orderId = $orderProduct->order_id;
         //var_dump($tastegroups,$orderTastes,$tasteMemo);exit;
     }
     if (Yii::app()->request->isPostRequest) {
         Until::validOperate($companyId, $this);
         $taste_memo = Yii::app()->request->getPost('taste_memo');
         $selectTasteList = Yii::app()->request->getPost('selectTasteList');
         $selectTastes = explode(',', $selectTasteList);
         if (TasteClass::save($companyId, $isall, $lid, $selectTastes, $taste_memo)) {
             $this->redirect(array('defaultOrder/order', 'companyId' => $companyId, 'orderId' => $orderId, 'typeId' => $typeId));
         }
     }
     $this->renderPartial('tastedetail', array('tastegroups' => $tastegroups, 'orderTastes' => $orderTastes, 'tasteMemo' => $tasteMemo, 'isall' => $isall, 'lid' => $lid, 'typeId' => $typeId));
 }
 public function actionSetOrderTaste()
 {
     $type = Yii::app()->request->getPost('type');
     $id = Yii::app()->request->getPost('id');
     $tasteMemo = Yii::app()->request->getPost('tasteMemo');
     $tasteIds = Yii::app()->request->getPost('tasteIds');
     if ($type == 1) {
         //全单口味
         $result = TasteClass::save($this->companyId, 1, $id, $tasteIds, $tasteMemo);
     } elseif ($type == 2) {
         //产品口味
         $result = TasteClass::save($this->companyId, 0, $id, $tasteIds, $tasteMemo);
     } elseif ($type == 3) {
         $result = FeedBackClass::save($this->companyId, $this->siteNoId, 1, $id, $tasteIds, $tasteMemo);
     }
     if ($result) {
         echo 1;
     } else {
         echo 0;
     }
     exit;
 }