Browse Source

hotfix

1. 修复签到失败的问题;
2. 修复流量重置价格获取错误的问题;
3. 支付设置问题
兔姬桑 5 years ago
parent
commit
290df1a0a6

+ 1 - 1
app/Http/Controllers/AdminController.php

@@ -2009,7 +2009,7 @@ EOF;
 					}
 					break;
 				case 'bitpayx':
-					if(!self::$systemConfig['bitpayx']){
+					if(!self::$systemConfig['bitpay_secret']){
 						return Response::json(['status' => 'fail', 'message' => '请先设置【麻瓜宝】必要参数']);
 					}
 					break;

+ 1 - 1
app/Http/Controllers/UserController.php

@@ -271,7 +271,7 @@ class UserController extends Controller
 	//重置流量
 	public function resetUserTraffic()
 	{
-		$temp = Order::uid()->where('status', 2)->where('is_expire', 0)->first();
+		$temp = Order::uid()->where('status', 2)->where('is_expire', 0)->with(['goods'])->whereHas('goods', function($q){ $q->where('type', 2); })->first();
 		$renewCost = Goods::query()->where('id', $temp->goods_id)->first()->renew;
 		if(Auth::user()->balance < $renewCost){
 			return Response::json(['status' => 'fail', 'data' => '', 'message' => '余额不足,请充值余额']);

+ 1 - 1
resources/views/user/index.blade.php

@@ -230,7 +230,7 @@
 	<script type="text/javascript">
         // 签到
         function checkIn() {
-            $.post('/checkIn', function (ret) {
+            $.post('/checkIn', {_token: '{{csrf_token()}}'}, function (ret) {
                 if (ret.status === 'success') {
                     swal.fire('长者的微笑', ret.message, 'success');
                 } else {