|
|
@ -2,6 +2,7 @@ |
|
|
|
|
|
|
|
|
namespace App\Models; |
|
|
namespace App\Models; |
|
|
|
|
|
|
|
|
|
|
|
use App\Common\OrderStatus; |
|
|
use App\Common\PayType; |
|
|
use App\Common\PayType; |
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory; |
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory; |
|
|
use Illuminate\Database\Eloquent\SoftDeletes; |
|
|
use Illuminate\Database\Eloquent\SoftDeletes; |
|
|
@ -13,6 +14,11 @@ class Order extends BaseModel |
|
|
use HasFactory, SoftDeletes; |
|
|
use HasFactory, SoftDeletes; |
|
|
protected $guarded = ['created_at', 'updated_at']; //不可批量赋值的属性
|
|
|
protected $guarded = ['created_at', 'updated_at']; //不可批量赋值的属性
|
|
|
|
|
|
|
|
|
|
|
|
public function scopeComplete($query) |
|
|
|
|
|
{ |
|
|
|
|
|
return $query->where('status',OrderStatus::SUCCESS); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
public function getCouponIdAttribute($value) |
|
|
public function getCouponIdAttribute($value) |
|
|
{ |
|
|
{ |
|
|
return explode(',', $value); |
|
|
return explode(',', $value); |
|
|
|