123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- <?php
- /**
- *
- *
- * @category xxx
- * @package PSR
- * @subpackage Documentation\API
- * @author xxx <xxx@xxx.com>
- * @license GPL https://xxx.com
- * @link https://xxx.com
- * @ctime: 2020/4/15 14:24
- */
- namespace App\Models;
- use App\Traits\ModelHelpers;
- class InviteNewUsersGiveGiftLog extends Model
- {
- use ModelHelpers;
- protected $table = 'invite_new_users_give_gift_logs';
- protected $fillable = ['user_id','invite_new_users_configs_id','gift_type','gift_id','gift_num','merchant_id'];
- const GIFT_TYPE_CARD = 'card';
- const GIFT_TYPE_COUPON = 'coupon';
- const GIFT_TYPE_BALANCE = 'balance';
- public static $giftTypeMaps = [
- self::GIFT_TYPE_CARD => '骑行卡',
- self::GIFT_TYPE_COUPON => '优惠券',
- self::GIFT_TYPE_BALANCE => '余额',
- ];
- public function inviteNewUsersConfig(){
- return $this->belongsTo(InviteNewUsersConfig::class,'invite_new_users_configs_id','id');
- }
- // public function gift(){
- // return $this->morphTo();
- // }
- public function users(){
- return $this->belongsTo(User::class,'user_id','id');
- }
- }
|