stanley-king 4 سال پیش
والد
کامیت
2a9baf8454
4فایلهای تغییر یافته به همراه7 افزوده شده و 40 حذف شده
  1. 5 4
      application/index/controller/Order.php
  2. 2 1
      composer.json
  3. 0 19
      tests/ExampleTest.php
  4. 0 16
      tests/TestCase.php

+ 5 - 4
application/index/controller/Order.php

@@ -61,6 +61,7 @@ class Order extends Base
         else {
             $alias = $cabinet['alias'];
             $this->box_action_record($cabinet_number , $trunk , 1 , $order_sn , $alias);
+
             $msg = "{$alias}柜门{$trunk}箱门,密码信息{$code}";
             $result = request_post(self::base_url . '/deliver' , ['orderCode' => $order_sn,"boxMsg" => $msg]);
             if($result == false){
@@ -69,7 +70,7 @@ class Order extends Base
             if($result['code'] != 0){
                 json_return($result['code'] , [] , $result['message']);
             }
-            //todo 存储到消息记录表里面。
+
             $this->CreateMsg($cabinet_number,$trunk,$msg,$order_sn,1);
             json_success($result['data']);
         }
@@ -149,8 +150,9 @@ class Order extends Base
 
     public function SendMsg(){
         $order_sn   = input('param.order_sn');
-        $box_number      = input('param.box_number');
-        $cabinet_number    = input('param.cabinet_number');
+        $box_number = input('param.box_number');
+        $cabinet_number = input('param.cabinet_number');
+
         $box = BoxModel::where(['cabinet_number' => $cabinet_number , 'box_number' => $box_number , 'order_sn' => $order_sn])->find();
         if(empty($box)){
             json_error(2004);
@@ -169,7 +171,6 @@ class Order extends Base
         if($result['code'] != 0){
             json_return($result['code'] , [] , $result['message']);
         }
-        //todo 存储到消息记录表里面。
         $this->CreateMsg($cabinet_number,$box_number,$msg,$order_sn,3);
         json_success($result['data']);
     }

+ 2 - 1
composer.json

@@ -18,7 +18,8 @@
     "require": {
         "php": ">=5.6.0",
         "topthink/framework": "5.1.*",
-        "topthink/think-testing": "2.0.*"
+        "topthink/think-testing": "2.0.*",
+      "ext-json": "*"
     },
     "autoload": {
         "psr-4": {

+ 0 - 19
tests/ExampleTest.php

@@ -1,19 +0,0 @@
-<?php
-// +----------------------------------------------------------------------
-// | ThinkPHP [ WE CAN DO IT JUST THINK IT ]
-// +----------------------------------------------------------------------
-// | Copyright (c) 2006-2015 http://thinkphp.cn All rights reserved.
-// +----------------------------------------------------------------------
-// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
-// +----------------------------------------------------------------------
-// | Author: yunwuxin <448901948@qq.com>
-// +----------------------------------------------------------------------
-namespace tests;
-
-class ExampleTest extends TestCase
-{
-    public function testBasicExample()
-    {
-        $this->visit('/')->see('ThinkPHP');
-    }
-}

+ 0 - 16
tests/TestCase.php

@@ -1,16 +0,0 @@
-<?php
-// +----------------------------------------------------------------------
-// | ThinkPHP [ WE CAN DO IT JUST THINK IT ]
-// +----------------------------------------------------------------------
-// | Copyright (c) 2006-2015 http://thinkphp.cn All rights reserved.
-// +----------------------------------------------------------------------
-// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
-// +----------------------------------------------------------------------
-// | Author: yunwuxin <448901948@qq.com>
-// +----------------------------------------------------------------------
-namespace tests;
-
-class TestCase extends \think\testing\TestCase
-{
-    protected $baseUrl = 'http://localhost';
-}