DengTao преди 8 години
родител
ревизия
75db7d429a

+ 1 - 0
www/protected/config/main.php

@@ -28,6 +28,7 @@ return array(
            'application.modules.o2o.models.*',
            'application.extensions.phpexcel.*',
 
+
     ),
 
     'modules'=>array(

+ 67 - 0
www/protected/controllers/TestController.php

@@ -0,0 +1,67 @@
+<?php
+/**
+ * Created by PhpStorm.
+ * User: PHP
+ * Date: 2016/12/15
+ * Time: 13:13
+ */
+
+
+class  TestController extends CController {
+
+
+    public function actionIndex()
+    {
+        $accessKey = 'Kn8GNMFOLKTNMUaKZ6r1wnjsgTk4ideQifK3umUr';
+        $secretKey = 'mLtD4GhBjQt_llcgx4rKlhAts9j8iJ0Qa5VmNyi2';
+        $auth = new Qiniu($accessKey, $secretKey);
+        var_dump($auth);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);
+        $this->assertNull($error);
+        list($status, $error) = PersistentFop::status($id);
+        $this->assertNotNull($status);
+        $this->assertNull($error);
+    }
+
+    public function actionIndex1(){
+        $accessKey = 'H1mZo5YAluX1n3Ic_gWFzQFAty0DedVK24gYWbvq';
+        $secretKey = 'Kod0wn_TWOAzFe4WJedhvVHu2CzRC_R3GtpRTPiV';
+        $auth = new Qiniu\Auth($accessKey, $secretKey);
+
+        //要转码的文件所在的空间和文件名
+        $bucket = 'video';
+        $key = 'af_055bd00624e2981480363953002.mp4';
+
+        //转码是使用的队列名称
+        $pipeline = '';
+        $pfop = new PersistentFop($auth, $bucket, $pipeline);
+
+        //要进行转码的转码操作
+        $fops = "vframe/jpg/offset/1";
+
+        list($id, $err) = $pfop->execute($key, $fops);
+        echo "\n====> pfop avthumb result: \n";
+        if ($err != null) {
+            var_dump($err);
+        } else {
+            echo "PersistentFop Id: $id\n";
+        }
+
+        //查询转码的进度和状态
+        list($ret, $err) = $pfop->status($id);
+        echo "\n====> pfop avthumb status: \n";
+        if ($err != null) {
+            var_dump($err);
+        } else {
+            var_dump($ret);
+        }
+    }
+}

+ 1 - 0
www/protected/modules/o2o/O2oModule.php

@@ -6,6 +6,7 @@ class O2oModule extends CWebModule
         $this->setImport(array(
             'o2o.controllers.*',
             'o2o.components.*',
+
         ));
     }
 }

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

@@ -231,10 +231,30 @@ class JingBaiController extends O2oBaseController
         $invoice_price = floatval(Yii::app()->getRequest()->getParam('invoicePrice',0));//发票价格
         //参数不能为空
         if (empty($OrderNo) || empty($ProductId) ||empty($name) ||empty($mobile) ||empty($address)  ||empty($memo) ||empty($count) ||empty($finalPrice) ||empty($booking_time) ) {
+            if(empty($OrderNo)){
+                $tmp = 'orderNo';
+            } else if(empty($ProductId)){
+                $tmp = 'ProductId';
+            }else if(empty($name)){
+                $tmp = 'ExpectedMotherName';
+            }else if(empty($mobile)){
+                $tmp = 'Mobile';
+            }else if(empty($address)){
+                $tmp = 'Address';
+            }else if(empty($memo)){
+                $tmp = 'Memo';
+            }else if(empty($count)){
+                $tmp = 'Quantity';
+            }else if(empty($finalPrice)){
+                $tmp = 'Price';
+            }else if(empty($booking_time)){
+                $tmp = 'AppointmentTime';
+            }
+
             echo '
             {
                "code": "10001",
-                "message": "缺少参数,请检查"
+                "message": "缺少参数,请检查'.$tmp.'"
             }
             ';
             die();

+ 1 - 0
www/protected/vendor/qiniu/php-sdk/tests/Qiniu/Tests/PfopTest.php

@@ -18,6 +18,7 @@ class PfopTest extends \PHPUnit_Framework_TestCase
         $this->assertNull($error);
         list($status, $error) = PersistentFop::status($id);
         $this->assertNotNull($status);
+        var_dump($status);
         $this->assertNull($error);
     }