1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- <?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',
- 'phone',
- 'role'
- ];
- public function role(){
- switch ($this->role){
- case 1:
- return '生产部';
- break;
- case 2:
- return '包装部';
- break;
- case 3:
- return '经理';
- break;
- default:
- return '普通用户';
- break;
- }
- }
- }
|