* @license GPL https://xxx.com * @link https://xxx.com * @ctime: 2020/4/15 11:42 */ namespace App\Models; use App\Traits\ModelHelpers; class InviteNewUser extends Model { use ModelHelpers; protected $table = 'invite_new_users'; protected $fillable = ['invite_id', 'register_id', 'source', 'is_card_certified', 'is_first_order', 'status','merchant_id']; const SOURCE_WECHATE = 1; public static $sourceMaps = [ self::SOURCE_WECHATE => '微信二维码', ]; const CARD_CERTIFIED_OK = 1; const CARD_CERTIFIED_NO = 0; public static $cardCertiedMaps = [ self::CARD_CERTIFIED_NO => '未实名', self::CARD_CERTIFIED_OK => '已实名' ]; const FIRST_ORDER_OK = 1; const FIRST_ORDER_NO = 0; public static $firstOrderMaps = [ self::FIRST_ORDER_NO => '未完成首单', self::FIRST_ORDER_OK => '已完成首单' ]; const STATUS_OK = 1; const STATUS_NO = 0; public static $statusMaps = [ self::STATUS_OK => '有效', self::STATUS_NO => '失效', ]; public function register(){ return $this->belongsTo(User::class,'register_id','id'); } public function invite(){ return $this->belongsTo(User::class,'invite_id','id'); } }