DengTao 8 lat temu
rodzic
commit
9ac341391a

+ 45 - 0
www/protected/controllers/ROrderController.php

@@ -862,6 +862,51 @@ class ROrderController extends AdminController{
             return false;
         }
 
+    }
+    //更新订单状态
+    /**
+     * @param $orderId  => order->orderNo
+     * @param $status  "00" 为创建订单,"01"为服务派单,"02"为服务完成
+     * @param $HouseKeepingId 巾帼园自己的订单号 对应order->_id
+     * @param $remark 订单备注
+     * @return bool
+     */
+    public function UpdateStatusForJingBai($orderId,$status,$HouseKeepingId,$remark){
+        $data['key']         = Yii::app()->params['shKey'];
+        $data['version']     = '1.0';
+        $data['serviceType'] = (int)26;
+        $data['orderId']     = (string)$orderId;
+        $data['status']      = $status;
+        ksort($data);
+        $str = '';
+        $dat = '';
+        foreach ($data as $key => $value) {
+            $str .= $key.'='.$value.'&';
+            $dat .= $key.'='.urlencode($value).'&';
+        }
+        $str = rtrim(trim($str),'&');
+
+        $str .= $str.Yii::app()->params['shMd5Key'];
+
+        $data['sign'] = strtoupper(md5($str));
+        $dat .= 'sign='.urlencode($data['sign']);//构建post 参数
+        $url = 'http://test2.app.hiwemeet.com/v2/openpf/home/order/thirdOrder/update';  //调用接口的平台服务地址
+
+        $ch = curl_init();
+        curl_setopt($ch, CURLOPT_DNS_USE_GLOBAL_CACHE, false);
+        curl_setopt($ch, CURLOPT_URL, $url);
+        curl_setopt($ch, CURLOPT_POST, 1);
+        curl_setopt ( $ch, CURLOPT_RETURNTRANSFER, 1 );
+        curl_setopt($ch, CURLOPT_POSTFIELDS, $dat);
+        $result = curl_exec($ch);
+        curl_close($ch);
+        $res = json_decode($result,true);
+        if ($res['code']){
+            return true;
+        } else {
+            return false;
+        }
+
     }
     public function actionOutputExcel(){
         $data = ROrder::model()->findAll();   //

+ 5 - 4
www/protected/controllers/TestController.php

@@ -7,21 +7,22 @@
  */
 
 
-class  TestController extends CController {
+Yii::import('application.vendor.qiniu.src.Qiniu.*',1);
+class  TestController extends AdminController {
 
 
     public function actionIndex()
     {
         $accessKey = 'Kn8GNMFOLKTNMUaKZ6r1wnjsgTk4ideQifK3umUr';
         $secretKey = 'mLtD4GhBjQt_llcgx4rKlhAts9j8iJ0Qa5VmNyi2';
-        $auth = new Qiniu($accessKey, $secretKey);
-        var_dump($auth);exit;
+        $auth = new Qiniu\Auth($accessKey, $secretKey);
+        var_dump($secretKey);exit;
         $bucket = 'video';
         $key = 'af_055bd00624e2981480363953002.mp4';
         $pfop = new PersistentFop($auth, $bucket);
 
         $fops = "?vframe/jpg/offset/1";
-        echo "1";exit;
+
         list($id, $error) = $pfop->execute($key, $fops);
         echo "2";
         var_dump($id);

+ 3 - 1
www/protected/modules/o2o/controllers/JingBaiController.php

@@ -221,7 +221,7 @@ class JingBaiController extends O2oBaseController
         $name = Yii::app()->getRequest()->getParam('ExpectedMotherName','');
         $mobile = Yii::app()->getRequest()->getParam('Mobile','');
         $address = Yii::app()->getRequest()->getParam('Address','');
-        $extra = Yii::app()->getRequest()->getParam('extra','');
+        $extra = json_decode(Yii::app()->getRequest()->getParam('extra',''),true);
         $memo = Yii::app()->getRequest()->getParam('Memo','');
         $areaId = intval(Yii::app()->getRequest()->getParam('areaId'));
         $count = intval(Yii::app()->getRequest()->getParam('Quantity',''));
@@ -271,6 +271,8 @@ class JingBaiController extends O2oBaseController
             $extra =array();
             $products[0]['extra'] = (object)$extra;
         }
+
+
         $rOrder->products     = $products;
         if (isset($extra['price'])) {
             $rOrder->price = floatval($extra['price']);