You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

25 lines
432 B

<?php
namespace App\Model\v3;
use App\Model\Model;
class CouponRec extends Model
{
protected $table = 'lanzu_coupon_receive';
protected $appends = [
'used_num'
];
public function getUsedNumAttribute()
{
return ($this->attributes['number'] - $this->attributes['number_remain']);
}
public function coupon()
{
return $this->hasOne(Coupon::class,'id','coupon_id');
}
}