123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- <?php
- namespace App\Models;
- use Illuminate\Notifications\Notifiable;
- use Laravel\Passport\HasApiTokens;
- use Illuminate\Foundation\Auth\User as Authenticatable;
- use Illuminate\Database\Eloquent\SoftDeletes;
- /**
- * @description 用户管理
- * @author system;
- * @version 1.0
- * @date 2018-05-14 13:25:12
- *
- */
- class AlbumUserModel extends Authenticatable
- {
- use HasApiTokens, Notifiable, SoftDeletes;
- /**
- * 数据表名
- *
- * @var string
- *
- */
- protected $table = 'album_user';
- /**
- * 主键
- */
- protected $primaryKey = 'id';
- //分页
- protected $perPage = PAGE_NUMS;
- /**
- * 可以被集体附值的表的字段
- *
- * @var string
- */
- protected $fillable = [
- 'username',
- 'wechat_open_id',
- 'address',
- 'lng',
- 'lat',
- 'g_open_id',
- 'open_id',
- 'wechat_union_id',
- 'avatar',
- 'store_id',
- 'is_dealer',
- 'is_boss',
- 'phone',
- 'role'
- ];
- public function role(){
- switch ($this->role){
- case 1:
- return '生产部';
- break;
- case 2:
- return '包装部';
- break;
- case 3:
- return '经理';
- break;
- case 4:
- return 'Boss';
- break;
- default:
- return '普通用户';
- break;
- }
- }
- }
|