update
This commit is contained in:
parent
a694128c0c
commit
fc59ecf522
@ -54,7 +54,9 @@ class UserLists extends BaseAdminDataLists implements ListsExcelInterface
|
|||||||
->limit($this->limitOffset, $this->limitLength)
|
->limit($this->limitOffset, $this->limitLength)
|
||||||
->field($field)
|
->field($field)
|
||||||
->order('id desc')
|
->order('id desc')
|
||||||
->select()->toArray();
|
->select()->each(function($data){
|
||||||
|
$data['sex_text'] = $data->sex_text;
|
||||||
|
})->toArray();
|
||||||
foreach ($lists as &$item) {
|
foreach ($lists as &$item) {
|
||||||
$item['channel'] = UserTerminalEnum::getTermInalDesc($item['channel']);
|
$item['channel'] = UserTerminalEnum::getTermInalDesc($item['channel']);
|
||||||
}
|
}
|
||||||
|
@ -26,7 +26,7 @@ class UserValidate extends BaseValidate
|
|||||||
'password' => 'require',
|
'password' => 'require',
|
||||||
'mobile' => 'require|mobile',
|
'mobile' => 'require|mobile',
|
||||||
'is_disable' => 'in:0,1',
|
'is_disable' => 'in:0,1',
|
||||||
'sex' => 'in:i,2',
|
'sex' => 'in:1,2',
|
||||||
'user_money' => 'float'
|
'user_money' => 'float'
|
||||||
];
|
];
|
||||||
|
|
||||||
@ -56,7 +56,7 @@ class UserValidate extends BaseValidate
|
|||||||
*/
|
*/
|
||||||
public function sceneAdd()
|
public function sceneAdd()
|
||||||
{
|
{
|
||||||
return $this->only(['real_name','nickname','account','password','mobile']);
|
return $this->remove('id',true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -68,7 +68,7 @@ class UserValidate extends BaseValidate
|
|||||||
*/
|
*/
|
||||||
public function sceneEdit()
|
public function sceneEdit()
|
||||||
{
|
{
|
||||||
return $this->only(['id','real_name','nickname','account','password','mobile'])->remove('password','require');
|
return $this->only(['id','avatar','real_name','nickname','account','password','mobile','is_disable','sex','user_money'])->remove('password','require');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -55,8 +55,10 @@ class OpurchaseGoodsOfferList extends BaseAdminDataLists implements ListsSearchI
|
|||||||
->order(['id' => 'desc'])
|
->order(['id' => 'desc'])
|
||||||
->select()->each(function($data){
|
->select()->each(function($data){
|
||||||
$data['is_adopt_text'] = $data->is_adopt_text;
|
$data['is_adopt_text'] = $data->is_adopt_text;
|
||||||
$unit = Unit::where('id',$data['goods']['unit'])->findOrEmpty();
|
if(!empty($data['goods'])){
|
||||||
$data['goods']['unit_name'] = !$unit->isEmpty() ? $unit->name : '';
|
$unit = Unit::where('id',$data['goods']['unit'])->findOrEmpty();
|
||||||
|
$data['goods']['unit_name'] = !$unit->isEmpty() ? $unit['name'] : '';
|
||||||
|
}
|
||||||
})
|
})
|
||||||
->toArray();
|
->toArray();
|
||||||
}
|
}
|
||||||
|
@ -120,9 +120,9 @@ class User extends BaseModel
|
|||||||
* @author 乔峰
|
* @author 乔峰
|
||||||
* @date 2022/9/7 15:15
|
* @date 2022/9/7 15:15
|
||||||
*/
|
*/
|
||||||
public function getSexAttr($value, $data)
|
public function getSexTextAttr($value, $data)
|
||||||
{
|
{
|
||||||
return UserEnum::getSexDesc($value);
|
return UserEnum::getSexDesc($data['sex']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user