diff --git a/app/admin/controller/shop/LocalStore.php b/app/admin/controller/shop/LocalStore.php index 05a5313b..921ddfef 100755 --- a/app/admin/controller/shop/LocalStore.php +++ b/app/admin/controller/shop/LocalStore.php @@ -2,6 +2,7 @@ namespace app\admin\controller\shop; +use app\admin\logic\groupbuy\GroupbuyLogic; use app\admin\logic\user\UserLogic; use app\common\basics\AdminBase; use app\common\server\ConfigServer; @@ -185,4 +186,41 @@ class LocalStore extends AdminBase } return JsonServer::success('', $result); } + + public function verify() + { + if ($this->request->isAjax()) { + $get = $this->request->get(); + $lists = LocalStoreLogic::verify_list($get); + return JsonServer::success('获取成功', $lists); + } + + $lstore_id = $this->request->get('lstore_id'); + + return view('', [ + 'lstore_id' => $lstore_id + ]); + } + + public function add_verify() + { + if ($this->request->isPost()) { + $params = $this->request->post(); + LocalStoreLogic::add_verify($params); + return JsonServer::success('添加成功'); + } + return view(); + } + + public function del_verify() + { + if ($this->request->isAjax()) { + $params = $this->request->post(); + $result = LocalStoreLogic::del_verify($params['ids']); + if ($result) { + return JsonServer::success('更新成功'); + } + return JsonServer::error('更新失败'); + } + } } \ No newline at end of file diff --git a/app/admin/logic/shop/LocalStoreLogic.php b/app/admin/logic/shop/LocalStoreLogic.php index be3e1318..f6ff2239 100755 --- a/app/admin/logic/shop/LocalStoreLogic.php +++ b/app/admin/logic/shop/LocalStoreLogic.php @@ -10,6 +10,7 @@ use app\common\server\ExportExcelServer; use app\common\server\WeChatServer; use EasyWeChat\Factory; use app\common\model\user\User; +use app\common\model\localstore\LocalStoreVerify; class LocalStoreLogic extends Logic { @@ -344,4 +345,55 @@ class LocalStoreLogic extends Logic return false; } } + + // 获取审核人员 + public static function verify_list($get) + { + $lists = LocalStoreVerify::with('user') + ->where([ + 'lstore_id' => $get['lstore_id'], + 'is_delete' => 0 + ]) + ->paginate([ + 'page' => $get['page'], + 'list_rows' => $get['limit'], + 'var_page' => 'page' + ])->toArray(); + return [ + 'lists' => $lists['data'], + 'count' => $lists['total'] + ]; + } + + // 添加审核人员 + public static function add_verify($form = array()) + { + try { + $data['lstore_id'] = $form['lstore_id']; + $data['user_id'] = $form['user_selected']['id']; + LocalStoreVerify::create($data); + return true; + } catch (\Exception $e) { + self::$error = $e->getMessage(); + return false; + } + } + + // 删除审核人员 + public static function del_verify($ids) + { + try { + $data = array(); + foreach ($ids as $k => $v) { + $data[$k]['id'] = $v; + $data[$k]['is_delete'] = 1; + $data[$k]['delete_time'] = time(); + } + (new LocalStoreVerify)->saveAll($data); + return true; + } catch (\Exception $e) { + self::$error = $e->getMessage(); + return false; + } + } } \ No newline at end of file diff --git a/app/admin/view/shop/local_store/add_verify.html b/app/admin/view/shop/local_store/add_verify.html new file mode 100755 index 00000000..4fc9197e --- /dev/null +++ b/app/admin/view/shop/local_store/add_verify.html @@ -0,0 +1,120 @@ +{layout name="layout1" /} + +