@@ -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);
@@ -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;
}
@@ -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'));