ソースを参照

自动任务错误

兔姬桑 4 年 前
コミット
720083de6a

+ 1 - 1
app/Components/NetworkDetection.php

@@ -66,7 +66,7 @@ class NetworkDetection {
 	 * @return bool|array
 	 */
 	public static function ping($ip) {
-		$url = 'https://api.iiwl.cc/api/ping.php?url='.$ip;
+		$url = 'https://api.iiwl.cc/api/ping.php?host='.$ip;
 
 		try{
 			$ret = json_decode(Curl::send($url), true);

+ 2 - 2
app/Console/Commands/AutoJob.php

@@ -115,8 +115,8 @@ class AutoJob extends Command {
 
 	//返回优惠券
 	private function returnCoupon($coupon_id): bool {
-		$coupon = Coupon::query()->whereId($coupon_id)->get();
-		if($coupon && $coupon->type < 3){
+		$coupon = Coupon::find($coupon_id);
+		if($coupon && $coupon->type !== 3){
 			Coupon::query()->whereId($coupon_id)->increment('usage_count', 1, ['status' => 0]);
 			return true;
 		}

+ 1 - 1
app/Http/Controllers/Admin/CouponController.php

@@ -89,7 +89,7 @@ class CouponController extends Controller {
 			$type = $request->input('type');
 
 			// 优惠卷LOGO
-			$logo = null;
+			$logo = '';
 			if($request->hasFile('logo')){
 				$logo = $this->uploadFile($request->file('logo'));