|
@@ -12,7 +12,9 @@ class Order extends Controller
|
|
$ret = ['check' => true,'order_sn' => $order_sn];
|
|
$ret = ['check' => true,'order_sn' => $order_sn];
|
|
json_success($ret);
|
|
json_success($ret);
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 订单绑定校验码
|
|
|
|
+ */
|
|
public function order_bind_code(){
|
|
public function order_bind_code(){
|
|
$order_sn = input('param.order_sn');
|
|
$order_sn = input('param.order_sn');
|
|
$OrderModel = new OrderModel();
|
|
$OrderModel = new OrderModel();
|
|
@@ -21,25 +23,23 @@ class Order extends Controller
|
|
if(empty($order)){
|
|
if(empty($order)){
|
|
return json(json_error_exception(1008));
|
|
return json(json_error_exception(1008));
|
|
}
|
|
}
|
|
- $code = $this->createRandCode($order_sn);
|
|
|
|
|
|
+ $code = $this->createRandCode();
|
|
|
|
+ $result = $OrderModel->editData(['order_sn' => $order_sn],['code' => $code]);
|
|
|
|
+ if($result['code'] != 1){
|
|
|
|
+ return json(json_error_exception('1006',$result['msg']));
|
|
|
|
+ }
|
|
|
|
+ json_return(200,[],'success');
|
|
}
|
|
}
|
|
-
|
|
|
|
- public function createRandCode($order_sn){
|
|
|
|
-
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 生成校验码
|
|
|
|
+ */
|
|
|
|
+ public function createRandCode(){
|
|
|
|
+ $code = rand(100000,999999);
|
|
|
|
+ $OrderModel = new OrderModel();
|
|
|
|
+ $order = $OrderModel->where('code',$code)->find();
|
|
|
|
+ if(!empty($order)){
|
|
|
|
+ $this->createRandCode();
|
|
|
|
+ }
|
|
|
|
+ return $code;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
-application/index/controller/Base.php application/index/controller/Box.php application/index/controller/Cabinet.php application/index/controller/Index.php application/index/controller/Node.php application/index/controller/Order.php
|
|
|
|
- application/index/controller/Role.php
|
|
|
|
- application/index/model/BoxModel.php
|
|
|
|
- application/index/model/CabinetModel.php
|
|
|
|
- application/index/model/NodeModel.php
|
|
|
|
- application/index/model/OrderModel.php
|
|
|
|
- application/index/model/RoleModel.php
|
|
|
|
- application/index/validate/CabinetValidate.php
|
|
|
|
- application/index/validate/RoleValidate.php
|
|
|
|
- application/index/validate/UserValidate.php
|
|
|
|
- conf/php-fpm/docker-php-fpm-start
|
|
|
|
- config/errorCode.php
|
|
|
|
- docker-compose-windows.yml
|
|
|
|
- route/route.php
|
|
|