AlbumUserModel.php 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <?php
  2. namespace App\Models;
  3. use Illuminate\Notifications\Notifiable;
  4. use Laravel\Passport\HasApiTokens;
  5. use Illuminate\Foundation\Auth\User as Authenticatable;
  6. use Illuminate\Database\Eloquent\SoftDeletes;
  7. /**
  8. * @description 用户管理
  9. * @author system;
  10. * @version 1.0
  11. * @date 2018-05-14 13:25:12
  12. *
  13. */
  14. class AlbumUserModel extends Authenticatable
  15. {
  16. use HasApiTokens, Notifiable, SoftDeletes;
  17. /**
  18. * 数据表名
  19. *
  20. * @var string
  21. *
  22. */
  23. protected $table = 'album_user';
  24. /**
  25. * 主键
  26. */
  27. protected $primaryKey = 'id';
  28. //分页
  29. protected $perPage = PAGE_NUMS;
  30. /**
  31. * 可以被集体附值的表的字段
  32. *
  33. * @var string
  34. */
  35. protected $fillable = [
  36. 'username',
  37. 'wechat_open_id',
  38. 'address',
  39. 'lng',
  40. 'lat',
  41. 'g_open_id',
  42. 'open_id',
  43. 'wechat_union_id',
  44. 'avatar',
  45. 'store_id',
  46. 'is_dealer',
  47. 'phone',
  48. 'role'
  49. ];
  50. public function role(){
  51. switch ($this->role){
  52. case 1:
  53. return '生产部';
  54. break;
  55. case 2:
  56. return '包装部';
  57. break;
  58. case 3:
  59. return '经理';
  60. break;
  61. default:
  62. return '普通用户';
  63. break;
  64. }
  65. }
  66. }