dataLists(new SupplierLists()); } /** * @notes 供应商申请列表 */ public function apply_lists() { $page_no = $this->request->get('page_no', 1); $page_size = $this->request->get('page_size', 15); $data = Db::name('user_auth_shop')->where('type', 2)->page($page_no, $page_size)->select()->each(function ($item) { $data = Supplier::where('id', $item['pid'])->find(); $item['supplier'] = $data; $item['apply_id'] = $item['id']; return $item; })->toArray(); $count = Db::name('user_auth_shop')->where('type', 2)->count(); return $this->success('请求成功', ['lists' => $data, 'count' => $count, 'page_no' => $page_no, 'page_size' => $page_size]); } /** * @notes 添加供应商管理 * @return \think\response\Json * @author likeadmin * @date 2024/04/27 14:33 */ public function add() { $params = (new SupplierValidate())->post()->goCheck('add'); $result = SupplierLogic::add($params); if (true === $result) { return $this->success('添加成功', [], 1, 1); } return $this->fail(SupplierLogic::getError()); } /** * @notes 编辑供应商管理 * @return \think\response\Json * @author likeadmin * @date 2024/04/27 14:33 */ public function edit() { $params = (new SupplierValidate())->post()->goCheck('edit'); $result = SupplierLogic::edit($params); if (true === $result) { return $this->success('编辑成功', [], 1, 1); } return $this->fail(SupplierLogic::getError()); } /** * @notes 编辑状态 * @return \think\response\Json * @author likeadmin * @date 2024/04/23 16:35 */ public function status() { $params = (new SupplierValidate())->post()->goCheck('status'); $result = SupplierLogic::status($params); if (true === $result) { return $this->success('编辑成功', [], 1, 1); } return $this->fail(SupplierLogic::getError()); } /** * @notes 删除供应商管理 * @return \think\response\Json * @author likeadmin * @date 2024/04/27 14:33 */ public function delete() { $params = (new SupplierValidate())->post()->goCheck('delete'); SupplierLogic::delete($params); return $this->success('删除成功', [], 1, 1); } /** * @notes 获取供应商管理详情 * @return \think\response\Json * @author likeadmin * @date 2024/04/27 14:33 */ public function detail() { $params = (new SupplierValidate())->goCheck('detail'); $result = SupplierLogic::detail($params); return $this->data($result); } public function setLabel() { $params = $this->request->post(); $result = SupplierLogic::setLabel($params); if (true === $result) { return $this->success('设置成功', [], 1, 1); } return $this->fail(SupplierLogic::getError()); } }