1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- <?php
- namespace App\Models;
- use Illuminate\Database\Eloquent\Model;
- class InviteNewUsersConfig extends Model
- {
- //
- protected $table = "invite_new_users_configs";
- protected $guarded = [];
- const CONDITION_IDCARD = 1;
- const CONDITION_NEW_ORDER = 2;
- public static $conditionMaps = [
- self::CONDITION_IDCARD => '实名认证',
- self::CONDITION_NEW_ORDER => '完成首单',
- ];
- const REPEAT_OK = 1;
- const REPEAT_NO = 0;
- public static $repeatMaps = [
- self::REPEAT_NO => '不可重复任务',
- self::REPEAT_OK => '可重复任务',
- ];
- const GIVE_CARD_OK = 1;
- const GIVE_CARD_NO = 0;
- public static $giveCardMaps = [
- self::GIVE_CARD_OK => '赠卡',
- self::GIVE_CARD_NO => '不赠卡',
- ];
- const GIVE_COUPON_OK = 1;
- const GIVE_COUPON_NO = 0;
- public static $giveCouponMaps = [
- self::GIVE_COUPON_NO=>'不送优惠券',
- self::GIVE_COUPON_OK=>'送优惠券',
- ];
- const STATUS_OK = 1;
- const STATUS_NO = 0;
- public static $statusMaps = [
- self::STATUS_OK => '启用',
- self::STATUS_NO => '停用',
- ];
- public function setDynamicItemAttribute($value){
- $this->attributes['dynamic_item'] = json_encode($value,true);
- }
- public function getDynamicItemAttribute($value){
- return json_decode($value,true);
- }
- public function areas(){
- return $this->belongsTo(Area::class,'area_id','id');
- }
- }
|