链街Dcat后台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

43 lines
896 B

<?php
namespace App\Models\v3;
use Illuminate\Database\Eloquent\Model;
class StoreUsers extends Model
{
protected $table = 'lanzu_store_users';
protected $dateFormat = 'U';
/**
* 获取单个用户信息
* @param int $id
* @param string $field
* @return object
*/
public static function getInfo($id,$field = '*')
{
return self::select($field)->find($id);
}
/**
* 获取用户数组
* id为键,name为值
* @return array
*/
public static function getArray()
{
$list = self::select('id','username')
->where('status',2)
->whereNull('deleted_at')
->get();
$array = [];
if(count($list) > 0){
foreach ($list as $value) {
$array[$value->id] = $value->username;
}
}
return $array;
}
}