فهرست منبع

confirm order

Charlie 8 سال پیش
والد
کامیت
b236d96747
1فایلهای تغییر یافته به همراه12 افزوده شده و 7 حذف شده
  1. 12 7
      www/protected/modules/o2o/controllers/OrderController.php

+ 12 - 7
www/protected/modules/o2o/controllers/OrderController.php

@@ -623,12 +623,17 @@ class  OrderController extends O2oBaseController{
         $success = $order->update(array('finish_time','status'),true);
         if($success ){
             // 保洁师订单统计
-            if ($order->technician) {
-                $tech_obj = TechInfo::get($order->technician);
-                if ($tech_obj) {
-                    $order_count = $tech_obj->order_count + 1;
-                    $tech_obj->order_count = $order_count;
+            if (isset($order->technicians)) {
+
+                foreach($order->technicians as $technician){
+                    $tech_obj = TechInfo::get($technician['technician_id']);
+                    if ($tech_obj) {
+                        $order_count = $tech_obj->order_count + 1;
+                        $tech_obj->order_count = $order_count;
+                    }
                 }
+
+
             }
             CommonFn::requestAjax(true,'订单已完成,期待您的下次预约');
         }else{
@@ -773,13 +778,13 @@ class  OrderController extends O2oBaseController{
      */
     public function actionTechComment() {
         $page = intval(Yii::app()->getRequest()->getParam("page",1));
-        $tech_id = intval(Yii::app()->getRequest()->getParam("tech_id"));
+        //$tech_id = intval(Yii::app()->getRequest()->getParam("tech_id"));
         $pagesize = Yii::app()->params['O2oCommentListPageSize'];
         if(!$tech_id){
             CommonFn::requestAjax(false,CommonFn::getMessage('message','params_illegal'));
         }
         $conditions = array(
-                            'technician'=>array('==',$tech_id),
+                            //'technician'=>array('==',$tech_id),
                             'status'=>array('==',1),
                         );
         $order = array(