self::STATUS_PENDING, ]; /** * @var array */ protected $fillable = [ 'sn', 'order_id', 'after_sale_id', 'amount', 'status', 'failed_reason', ]; /** * 只查询待退款的任务 */ public function scopePending($query) { return $query->where('status', static::STATUS_PENDING); } /** * 此退款任务所属的订单 */ public function order() { return $this->belongsTo(Order::class); } }