40 lines
724 B
PHP
40 lines
724 B
PHP
|
<?php
|
||
|
|
||
|
namespace app\model;
|
||
|
|
||
|
|
||
|
|
||
|
use support\Model;
|
||
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
||
|
|
||
|
class User extends Model
|
||
|
{
|
||
|
/**
|
||
|
* The table associated with the model.
|
||
|
*
|
||
|
* @var string
|
||
|
*/
|
||
|
protected $table = 'user';
|
||
|
|
||
|
/**
|
||
|
* The primary key associated with the table.
|
||
|
*
|
||
|
* @var string
|
||
|
*/
|
||
|
protected $primaryKey = 'id';
|
||
|
|
||
|
/**
|
||
|
* Indicates if the model should be timestamped.
|
||
|
*
|
||
|
* @var bool
|
||
|
*/
|
||
|
public $timestamps = true;
|
||
|
|
||
|
public static function getUser($userId)
|
||
|
{
|
||
|
$user = User::first()->select(['id','name','sex','role','avatar','email','password'])
|
||
|
->where('status',0)
|
||
|
->toArray();
|
||
|
return $user;
|
||
|
}
|
||
|
}
|