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.
29 lines
696 B
29 lines
696 B
/**
|
|
* 修改状态
|
|
* @param $id
|
|
* @return \think\Response
|
|
* @date {%DATE%}
|
|
*/
|
|
public function status($id)
|
|
{
|
|
if (!$id) {
|
|
return app('json')->fail(100100);
|
|
}
|
|
|
|
$data = $this->request->postMore([
|
|
['field', ''],
|
|
['value', '']
|
|
]);
|
|
|
|
$filedAll = {%FIELD_ALL_PHP%};
|
|
|
|
if (!in_array($data['field'], $filedAll)) {
|
|
return app('json')->fail(100100);
|
|
}
|
|
|
|
if ($this->service->update(['id'=> $id], [$data['field']=> $data['value']])) {
|
|
return app('json')->success(100001);
|
|
} else {
|
|
return app('json')->fail(100100);
|
|
}
|
|
}
|
|
|