<?php namespace App\Models; use App\Http\Services\AutoAssignCustomerService; use App\Http\Services\UserService; use Illuminate\Contracts\Auth\MustVerifyEmail; use Illuminate\Foundation\Auth\User as Authenticatable; use Illuminate\Notifications\Notifiable; use Illuminate\Support\Facades\Hash; class UserModel extends Authenticatable implements MustVerifyEmail { use Notifiable; protected $table = 'users'; /** * The attributes that are mass assignable. * * @var array */ public $timestamps = false; /** * The attributes that should be hidden for arrays. * * @var array */ protected $hidden = [ 'password', 'remember_token', ]; /** * The attributes that should be cast to native types. * * @var array */ protected $casts = [ 'email_verified_at' => 'datetime', ]; const ACCOUNT_PROPERTIES_PERSONAL = 1; const ACCOUNT_PROPERTIES_COMPANY = 2; //获取用户详情 public static function getUserInfo($user_id) { $map = [ "id" => $user_id ]; $res = self::where($map)->first(); return ($res) ? $res->toArray() : []; } }