作者 sgj
1 个管道 的构建 失败 耗费 0 秒

志愿者修改

... ... @@ -21,6 +21,7 @@ class GoodController extends AdminBaseController
public function index(){
$param=$this->request->param();
$map=[];
$map['delete_time']=null;
$data= db('goods')->where($map)->order('id desc')->paginate();
$data->appends($param);
$list=$data->items();
... ... @@ -98,4 +99,20 @@ class GoodController extends AdminBaseController
}
}
/**
* 删除
* @throws \think\Exception
* @throws \think\exception\PDOException
*/
public function delete(){
$id=input('id');
$update['delete_time']=time();
$result=db('goods')->where('id',$id)->update($update);
if ($result){
$this->success('操作成功!');
}else{
$this->error('操作失败!');
}
}
}
\ No newline at end of file
... ...