作者 王智

修改

1 <?php 1 <?php
2 2
3 namespace app\common\controller; 3 namespace app\common\controller;
  4 +
4 use EasyWeChat\Foundation\Application; 5 use EasyWeChat\Foundation\Application;
5 use app\common\library\Auth; 6 use app\common\library\Auth;
6 use think\Config; 7 use think\Config;
@@ -14,7 +15,9 @@ use think\Response; @@ -14,7 +15,9 @@ use think\Response;
14 use think\Route; 15 use think\Route;
15 use think\Validate; 16 use think\Validate;
16 use think\Db; 17 use think\Db;
  18 +
17 //use EasyWeChat\Factory; 19 //use EasyWeChat\Factory;
  20 +
18 /** 21 /**
19 * API控制器基类 22 * API控制器基类
20 */ 23 */
@@ -327,7 +330,7 @@ class Api @@ -327,7 +330,7 @@ class Api
327 protected function IsToken($token) 330 protected function IsToken($token)
328 { 331 {
329 if (empty($token['token'])) { 332 if (empty($token['token'])) {
330 - $this->error('请登录后在操作'); 333 + $this->error('请登录后在操作', '', 401);
331 } 334 }
332 $is_token = Db::name('user')->where(['token' => $token['token']])->find(); 335 $is_token = Db::name('user')->where(['token' => $token['token']])->find();
333 if (!$is_token) { 336 if (!$is_token) {
@@ -390,7 +393,8 @@ class Api @@ -390,7 +393,8 @@ class Api
390 } 393 }
391 394
392 395
393 - public function Tuikuan($OrderSn){ 396 + public function Tuikuan($OrderSn)
  397 + {
394 $PayOrderInfo = Db::name('pay_order')->where('OrderSn', $OrderSn)->where('type', 1)->find(); 398 $PayOrderInfo = Db::name('pay_order')->where('OrderSn', $OrderSn)->where('type', 1)->find();
395 $TuiMoney = $PayOrderInfo['UpMoney'] + $PayOrderInfo['Money']; 399 $TuiMoney = $PayOrderInfo['UpMoney'] + $PayOrderInfo['Money'];
396 //配置 400 //配置