正在显示
1 个修改的文件
包含
8 行增加
和
4 行删除
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) { |
@@ -388,9 +391,10 @@ class Api | @@ -388,9 +391,10 @@ class Api | ||
388 | $PayOrder = $yCode[intval(date('Y')) - 2011] . strtoupper(dechex(date('m'))) . date('d') . substr(time(), -5) . substr(microtime(), 2, 5) . sprintf('%02d', rand(0, 99)); | 391 | $PayOrder = $yCode[intval(date('Y')) - 2011] . strtoupper(dechex(date('m'))) . date('d') . substr(time(), -5) . substr(microtime(), 2, 5) . sprintf('%02d', rand(0, 99)); |
389 | return $PayOrder; | 392 | return $PayOrder; |
390 | } | 393 | } |
391 | - | ||
392 | - | ||
393 | - public function Tuikuan($OrderSn){ | 394 | + |
395 | + | ||
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 | //配置 |
-
请 注册 或 登录 后发表评论