InviteNewUser.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <?php
  2. /**
  3. *
  4. *
  5. * @category xxx
  6. * @package PSR
  7. * @subpackage Documentation\API
  8. * @author xxx <xxx@xxx.com>
  9. * @license GPL https://xxx.com
  10. * @link https://xxx.com
  11. * @ctime: 2020/4/15 11:42
  12. */
  13. namespace App\Models;
  14. use App\Traits\ModelHelpers;
  15. class InviteNewUser extends Model
  16. {
  17. use ModelHelpers;
  18. protected $table = 'invite_new_users';
  19. protected $fillable = ['invite_id', 'register_id', 'source', 'is_card_certified', 'is_first_order', 'status','merchant_id'];
  20. const SOURCE_WECHATE = 1;
  21. public static $sourceMaps = [
  22. self::SOURCE_WECHATE => '微信二维码',
  23. ];
  24. const CARD_CERTIFIED_OK = 1;
  25. const CARD_CERTIFIED_NO = 0;
  26. public static $cardCertiedMaps = [
  27. self::CARD_CERTIFIED_NO => '未实名',
  28. self::CARD_CERTIFIED_OK => '已实名'
  29. ];
  30. const FIRST_ORDER_OK = 1;
  31. const FIRST_ORDER_NO = 0;
  32. public static $firstOrderMaps = [
  33. self::FIRST_ORDER_NO => '未完成首单',
  34. self::FIRST_ORDER_OK => '已完成首单'
  35. ];
  36. const STATUS_OK = 1;
  37. const STATUS_NO = 0;
  38. public static $statusMaps = [
  39. self::STATUS_OK => '有效',
  40. self::STATUS_NO => '失效',
  41. ];
  42. public function register(){
  43. return $this->belongsTo(User::class,'register_id','id');
  44. }
  45. public function invite(){
  46. return $this->belongsTo(User::class,'invite_id','id');
  47. }
  48. }