From 9b81c17b3963c5c59aab060019fc25777b3775de Mon Sep 17 00:00:00 2001 From: monanxiao Date: Sat, 4 Mar 2023 11:41:12 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=BB=BA=E5=95=86=E5=93=81=E3=80=81?= =?UTF-8?q?=E5=95=86=E6=88=B7=E7=B1=BB=E5=9E=8B=E3=80=81=E5=95=86=E6=88=B7?= =?UTF-8?q?=E5=88=86=E7=B1=BB=E3=80=81=E5=95=86=E5=93=81=E5=88=86=E7=B1=BB?= =?UTF-8?q?=E3=80=81=E8=AF=84=E8=AE=BA=E6=A8=A1=E5=9E=8B=EF=BC=9B=E6=96=B0?= =?UTF-8?q?=E5=BB=BA=E5=95=86=E5=93=81=E3=80=81=E5=95=86=E5=93=81=E5=88=86?= =?UTF-8?q?=E7=B1=BB=E3=80=81=E8=AF=84=E8=AE=BA=E6=8E=A7=E5=88=B6=E5=99=A8?= =?UTF-8?q?=EF=BC=9B=E6=96=B0=E5=BB=BA=E5=95=86=E5=93=81=E3=80=81=E5=95=86?= =?UTF-8?q?=E5=93=81=E5=88=86=E7=B1=BB=E3=80=81=E8=AF=84=E8=AE=BA=E8=A7=86?= =?UTF-8?q?=E5=9B=BE=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/controller/product/Classify.php | 262 ++++++++++++++++++++ app/admin/controller/product/Comment.php | 263 +++++++++++++++++++++ app/admin/controller/product/Product.php | 262 ++++++++++++++++++++ app/admin/model/EbStoreProduct.php | 11 +- app/admin/model/Merchant.php | 19 ++ app/admin/model/MerchantCategory.php | 22 ++ app/admin/model/MerchantType.php | 22 ++ app/admin/model/StoreCategory.php | 22 ++ app/admin/model/StoreProductReply.php | 51 ++++ app/admin/view/product/classify/add.html | 200 ++++++++++++++++ app/admin/view/product/classify/edit.html | 188 +++++++++++++++ app/admin/view/product/classify/index.html | 185 +++++++++++++++ app/admin/view/product/comment/add.html | 200 ++++++++++++++++ app/admin/view/product/comment/edit.html | 188 +++++++++++++++ app/admin/view/product/comment/index.html | 200 ++++++++++++++++ app/admin/view/product/product/add.html | 200 ++++++++++++++++ app/admin/view/product/product/edit.html | 188 +++++++++++++++ app/admin/view/product/product/index.html | 236 ++++++++++++++++++ 18 files changed, 2718 insertions(+), 1 deletion(-) create mode 100644 app/admin/controller/product/Classify.php create mode 100644 app/admin/controller/product/Comment.php create mode 100644 app/admin/controller/product/Product.php create mode 100644 app/admin/model/MerchantCategory.php create mode 100644 app/admin/model/MerchantType.php create mode 100644 app/admin/model/StoreCategory.php create mode 100644 app/admin/model/StoreProductReply.php create mode 100644 app/admin/view/product/classify/add.html create mode 100644 app/admin/view/product/classify/edit.html create mode 100644 app/admin/view/product/classify/index.html create mode 100644 app/admin/view/product/comment/add.html create mode 100644 app/admin/view/product/comment/edit.html create mode 100644 app/admin/view/product/comment/index.html create mode 100644 app/admin/view/product/product/add.html create mode 100644 app/admin/view/product/product/edit.html create mode 100644 app/admin/view/product/product/index.html diff --git a/app/admin/controller/product/Classify.php b/app/admin/controller/product/Classify.php new file mode 100644 index 0000000..efd9cbb --- /dev/null +++ b/app/admin/controller/product/Classify.php @@ -0,0 +1,262 @@ +adminInfo = get_login_admin(); + $this->category_id=354; + $this->url=[ + '/admin/product.classify/index?category_id='.$this->category_id, + '/admin/product.classify/add', + '/admin/product.classify/edit', + '/admin/product.classify/delete' + ]; + } + + /** + * + * 商城分类列表 + * + */ + public function index() + { + if (request()->isAjax()) { + + $params= get_params(); + + $where = []; + + if (isset($params['keywords']) && !empty($params['keywords'])){ + $where[]= ['name','like','%'.$params['keywords'].'%']; + } + if($this->adminInfo['position_id'] != 1){ //不是超级管理员 + $www['admin_id'] = $this->adminInfo['id']; + $user_address = Db::table('fa_szxc_information_useraddress')->where($www)->find(); + if ($user_address){ + if($user_address['auth_range'] == 1){ + $where[] = ['village_id','=',$user_address['village_id']]; + }elseif ($user_address['auth_range'] == 2){ + $where[] = ['street_id','=',$user_address['street_id']]; + }elseif ($user_address['auth_range'] == 3){ + $where[] = ['area_id','=',$user_address['area_id']]; + }else{ + $where[] = ['village_id','=',$user_address['village_id']]; + } + }else{ + $where[] = ['village_id','=','']; + } + } + + $total = StoreCategory::where('level', 0)->where('mer_id', 0)->where($where)->count(); + + // $list = StoreCategory::with(['merchant', 'street', 'area'])->order('id desc')->select(); + $list = StoreCategory::where('level', 0)->where('mer_id', 0)->order('store_category_id desc')->select(); + + View::assign('url', $this->url); + View::assign('list', $list); + + $result = ['total' => $total, 'data' => $list]; + + return table_assign(0, '', $result); + + }else{ + + $list = StoreCategory::where('level', 0)->where('mer_id', 0)->select(); + + View::assign('url', $this->url); + View::assign('list', $list); + return view(); + } + } + + /** + * + * 新增 + * + */ + public function add() + { + if (request()->isAjax()) { + + $params = get_params(); + + $data['user_id'] = $this->adminInfo['id']; // 操作用户ID + $data['name'] = $params['title']; // 团队名称 + $data['tel'] = $params['phone']; // 联系电话 + $data['mer_id_list'] = json_encode($params['mer_id']); // 已选商户 + + $data['street_id'] = $params['street_id']; // 街道ID + $street = GeoStreet::where('street_id', $data['street_id'])->find(); // 街道数据 + $data['lng'] = $street['lng']; // 经度 + $data['lat'] = $street['lat']; // 纬度 + $area = $street->area; // 区数据 + $data['area_id'] = $area['area_id']; // 区县id + $city = $area->city; // 获取市级 + $data['address'] = $city['city_name'] . $area['area_name'] . $street['street_name']; // 实际地址 + $data['create_time'] = date('Y-m-d H:i:s'); + + // 数据入库 + $res = SupplyChain::create($data); + + // 关联数据入库 + foreach ($params['mer_id'] as $v) { + + $dataLink = [ + 'eb_merchant_id' => $v, // 商户ID + 'user_id' => $data['user_id'], + 'create_time' => $data['create_time'], + ]; + + $res->linkMerchant()->save($dataLink); // 插入关联数据 + } + + if ($res){ + return to_assign(0,'操作成功',['aid'=>$res]); + } + + return to_assign(1, '操作失败,原因:'.$res); + + }else{ + + // 取出正常的商家 + $merchant = Merchant::where('status', 1)->column('mer_id, real_name'); + + // 区域模型 + $arealist = GeoArea::where('city_code', '510500')->select(); + + View::assign('editor', get_system_config('other','editor')); + View::assign('arealist', $arealist); + View::assign('merchant', $merchant); + View::assign('url', $this->url); + return view(); + } + } + + /** + * + * 编辑 + * + */ + public function edit() + { + $id = get_params("id"); + if(!$id) return to_assign(1, '非法操作!'); + + if (request()->isAjax()) { + + $params = get_params(); + + $data['id'] = $params['id']; // 当前ID + $data['user_id'] = $this->adminInfo['id']; // 操作用户ID + $data['name'] = $params['title']; // 团队名称 + $data['tel'] = $params['phone']; // 联系电话 + $data['mer_id_list'] = isset($params['mer_id']) ? json_encode($params['mer_id']) : null; // 已选商户 + $data['street_id'] = $params['street_id']; // 街道ID + $street = GeoStreet::where('street_id', $data['street_id'])->find(); // 街道数据 + $data['lng'] = $street['lng']; // 经度 + $data['lat'] = $street['lat']; // 纬度 + $area = $street->area; // 区数据 + $data['area_id'] = $area['area_id']; // 区县id + $city = $area->city; // 获取市级 + $data['address'] = $city['city_name'] . $area['area_name'] . $street['street_name']; // 实际地址 + $data['create_time'] = date('Y-m-d H:i:s'); + + // 数据更新 + $supplyChain = SupplyChain::with(['linkMerchant'])->find($data['id']); + $res = $supplyChain->update($data); + + // 获取关联数据一对一---曲线救国 + $linkMerchant = $supplyChain['linkMerchant']; + // $linkMerchantArr = $linkMerchant->column('id'); + + // 先删除关联数据-- 曲线救国 + $linkMerchant->delete(); + + // 关联商户状态 + if($data['mer_id_list']) + { + // 再重新将关联数据入库 + foreach ($params['mer_id'] as $v) { + + $dataLink = [ + 'eb_merchant_id' => $v, // 商户ID + 'user_id' => $data['user_id'], + 'create_time' => $data['create_time'], + ]; + + $supplyChain->linkMerchant()->save($dataLink); + } + } + + if ($res){ + return to_assign(0,'操作成功',['aid'=>$res]); + } + + return to_assign(1, '操作失败,原因:'.$res); + + }else{ + + $category = StoreCategory::find($id); // 取出当前供应链数据 + + View::assign('detail', $category); + + // 取出正常的商家 + $merchant = Merchant::where('status', 1)->column('mer_id, real_name'); + // 区域模型 + $arealist = GeoArea::where('city_code', '510500')->select(); + + View::assign('arealist', $arealist); + View::assign('merchant', $merchant); + View::assign('url', $this->url); + return view(); + } + + } + + /** + * + * 删除 + * + */ + public function delete() + { + $id = get_params("id"); + if(!$id) return to_assign(1, '非法操作!'); + + $supplyChain = SupplyChain::with(['linkMerchant'])->find($id); + // 删除关联模型 + $res = $supplyChain->together(['linkMerchant'])->delete(); + + if ($res){ + return to_assign(0,'操作成功',['aid'=>$res]); + } + + return to_assign(1, '操作失败,原因:'.$res); + + } + +} \ No newline at end of file diff --git a/app/admin/controller/product/Comment.php b/app/admin/controller/product/Comment.php new file mode 100644 index 0000000..a4183ba --- /dev/null +++ b/app/admin/controller/product/Comment.php @@ -0,0 +1,263 @@ +adminInfo = get_login_admin(); + $this->category_id=354; + $this->url=[ + '/admin/product.comment/index?category_id='.$this->category_id, + '/admin/product.comment/add', + '/admin/product.comment/edit', + '/admin/product.comment/del', + '/admin/product.comment/index', + ]; + } + + /** + * + * 商品评论列表 + * + */ + public function index() + { + if (request()->isAjax()) { + + $params= get_params(); + + $where = []; + + if (isset($params['keywords']) && !empty($params['keywords'])){ + $where[]= ['name','like','%'.$params['keywords'].'%']; + } + if($this->adminInfo['position_id'] != 1){ //不是超级管理员 + $www['admin_id'] = $this->adminInfo['id']; + $user_address = Db::table('fa_szxc_information_useraddress')->where($www)->find(); + if ($user_address){ + if($user_address['auth_range'] == 1){ + $where[] = ['village_id','=',$user_address['village_id']]; + }elseif ($user_address['auth_range'] == 2){ + $where[] = ['street_id','=',$user_address['street_id']]; + }elseif ($user_address['auth_range'] == 3){ + $where[] = ['area_id','=',$user_address['area_id']]; + }else{ + $where[] = ['village_id','=',$user_address['village_id']]; + } + }else{ + $where[] = ['village_id','=','']; + } + } + + $total = StoreProductReply::where($where)->count(); + + $list = StoreProductReply::with(['product'])->order('reply_id desc')->select(); + + View::assign('url', $this->url); + View::assign('list', $list); + + $result = ['total' => $total, 'data' => $list]; + + return table_assign(0, '', $result); + + }else{ + + $list = StoreProductReply::select(); + + View::assign('url', $this->url); + View::assign('list', $list); + return view(); + } + } + + /** + * + * 新增 + * + */ + public function add() + { + if (request()->isAjax()) { + + $params = get_params(); + + $data['user_id'] = $this->adminInfo['id']; // 操作用户ID + $data['name'] = $params['title']; // 团队名称 + $data['tel'] = $params['phone']; // 联系电话 + $data['mer_id_list'] = json_encode($params['mer_id']); // 已选商户 + + $data['street_id'] = $params['street_id']; // 街道ID + $street = GeoStreet::where('street_id', $data['street_id'])->find(); // 街道数据 + $data['lng'] = $street['lng']; // 经度 + $data['lat'] = $street['lat']; // 纬度 + $area = $street->area; // 区数据 + $data['area_id'] = $area['area_id']; // 区县id + $city = $area->city; // 获取市级 + $data['address'] = $city['city_name'] . $area['area_name'] . $street['street_name']; // 实际地址 + $data['create_time'] = date('Y-m-d H:i:s'); + + // 数据入库 + $res = SupplyChain::create($data); + + // 关联数据入库 + foreach ($params['mer_id'] as $v) { + + $dataLink = [ + 'eb_merchant_id' => $v, // 商户ID + 'user_id' => $data['user_id'], + 'create_time' => $data['create_time'], + ]; + + $res->linkMerchant()->save($dataLink); // 插入关联数据 + } + + if ($res){ + return to_assign(0,'操作成功',['aid'=>$res]); + } + + return to_assign(1, '操作失败,原因:'.$res); + + }else{ + + // 取出正常的商家 + $merchant = Merchant::where('status', 1)->column('mer_id, real_name'); + + // 区域模型 + $arealist = GeoArea::where('city_code', '510500')->select(); + + View::assign('editor', get_system_config('other','editor')); + View::assign('arealist', $arealist); + View::assign('merchant', $merchant); + View::assign('url', $this->url); + return view(); + } + } + + /** + * + * 编辑 + * + */ + public function edit() + { + $id = get_params("id"); + if(!$id) return to_assign(1, '非法操作!'); + + if (request()->isAjax()) { + + $params = get_params(); + + $data['id'] = $params['id']; // 当前ID + $data['user_id'] = $this->adminInfo['id']; // 操作用户ID + $data['name'] = $params['title']; // 团队名称 + $data['tel'] = $params['phone']; // 联系电话 + $data['mer_id_list'] = isset($params['mer_id']) ? json_encode($params['mer_id']) : null; // 已选商户 + $data['street_id'] = $params['street_id']; // 街道ID + $street = GeoStreet::where('street_id', $data['street_id'])->find(); // 街道数据 + $data['lng'] = $street['lng']; // 经度 + $data['lat'] = $street['lat']; // 纬度 + $area = $street->area; // 区数据 + $data['area_id'] = $area['area_id']; // 区县id + $city = $area->city; // 获取市级 + $data['address'] = $city['city_name'] . $area['area_name'] . $street['street_name']; // 实际地址 + $data['create_time'] = date('Y-m-d H:i:s'); + + // 数据更新 + $supplyChain = SupplyChain::with(['linkMerchant'])->find($data['id']); + $res = $supplyChain->update($data); + + // 获取关联数据一对一---曲线救国 + $linkMerchant = $supplyChain['linkMerchant']; + // $linkMerchantArr = $linkMerchant->column('id'); + + // 先删除关联数据-- 曲线救国 + $linkMerchant->delete(); + + // 关联商户状态 + if($data['mer_id_list']) + { + // 再重新将关联数据入库 + foreach ($params['mer_id'] as $v) { + + $dataLink = [ + 'eb_merchant_id' => $v, // 商户ID + 'user_id' => $data['user_id'], + 'create_time' => $data['create_time'], + ]; + + $supplyChain->linkMerchant()->save($dataLink); + } + } + + if ($res){ + return to_assign(0,'操作成功',['aid'=>$res]); + } + + return to_assign(1, '操作失败,原因:'.$res); + + }else{ + + $supplyChain = SupplyChain::with(['merchant', 'street', 'area'])->find($id); // 取出当前供应链数据 + + View::assign('detail', $supplyChain); + + // 取出正常的商家 + $merchant = Merchant::where('status', 1)->column('mer_id, real_name'); + // 区域模型 + $arealist = GeoArea::where('city_code', '510500')->select(); + + View::assign('arealist', $arealist); + View::assign('merchant', $merchant); + View::assign('url', $this->url); + return view(); + } + + } + + /** + * + * 删除 + * + */ + public function del() + { + $id = get_params("id"); + + if(!$id) return to_assign(1, '非法操作!'); + + $res = StoreProductReply::where('reply_id', $id)->delete(); + + if ($res){ + return to_assign(0,'操作成功',['aid'=>$res]); + } + + return to_assign(1, '操作失败,原因:'.$res); + + } + +} \ No newline at end of file diff --git a/app/admin/controller/product/Product.php b/app/admin/controller/product/Product.php new file mode 100644 index 0000000..0d3466a --- /dev/null +++ b/app/admin/controller/product/Product.php @@ -0,0 +1,262 @@ +adminInfo = get_login_admin(); + $this->category_id=354; + $this->url=[ + '/admin/product.product/index?category_id='.$this->category_id, + '/admin/product.product/add', + '/admin/product.product/edit', + '/admin/product.product/delete', + '/admin/product.product/index', + ]; + } + + /** + * + * 供应链团队列表 + * + */ + public function index() + { + if (request()->isAjax()) { + + $params= get_params(); + + $where = []; + + if (isset($params['keywords']) && !empty($params['keywords'])){ + $where[]= ['name','like','%'.$params['keywords'].'%']; + } + if($this->adminInfo['position_id'] != 1){ //不是超级管理员 + $www['admin_id'] = $this->adminInfo['id']; + $user_address = Db::table('fa_szxc_information_useraddress')->where($www)->find(); + if ($user_address){ + if($user_address['auth_range'] == 1){ + $where[] = ['village_id','=',$user_address['village_id']]; + }elseif ($user_address['auth_range'] == 2){ + $where[] = ['street_id','=',$user_address['street_id']]; + }elseif ($user_address['auth_range'] == 3){ + $where[] = ['area_id','=',$user_address['area_id']]; + }else{ + $where[] = ['village_id','=',$user_address['village_id']]; + } + }else{ + $where[] = ['village_id','=','']; + } + } + + $total = EbStoreProduct::where($where)->count(); + + $list = EbStoreProduct::with(['merchant' => ['merchantType', 'category']])->order('product_id desc')->select(); + + View::assign('url', $this->url); + View::assign('list', $list); + + $result = ['total' => $total, 'data' => $list]; + + return table_assign(0, '', $result); + + }else{ + + $list = SupplyChain::with(['merchant' => ['merchantType', 'category']])->select(); + + View::assign('url', $this->url); + View::assign('list', $list); + return view(); + } + } + + /** + * + * 新增 + * + */ + public function add() + { + if (request()->isAjax()) { + + $params = get_params(); + + $data['user_id'] = $this->adminInfo['id']; // 操作用户ID + $data['name'] = $params['title']; // 团队名称 + $data['tel'] = $params['phone']; // 联系电话 + $data['mer_id_list'] = json_encode($params['mer_id']); // 已选商户 + + $data['street_id'] = $params['street_id']; // 街道ID + $street = GeoStreet::where('street_id', $data['street_id'])->find(); // 街道数据 + $data['lng'] = $street['lng']; // 经度 + $data['lat'] = $street['lat']; // 纬度 + $area = $street->area; // 区数据 + $data['area_id'] = $area['area_id']; // 区县id + $city = $area->city; // 获取市级 + $data['address'] = $city['city_name'] . $area['area_name'] . $street['street_name']; // 实际地址 + $data['create_time'] = date('Y-m-d H:i:s'); + + // 数据入库 + $res = SupplyChain::create($data); + + // 关联数据入库 + foreach ($params['mer_id'] as $v) { + + $dataLink = [ + 'eb_merchant_id' => $v, // 商户ID + 'user_id' => $data['user_id'], + 'create_time' => $data['create_time'], + ]; + + $res->linkMerchant()->save($dataLink); // 插入关联数据 + } + + if ($res){ + return to_assign(0,'操作成功',['aid'=>$res]); + } + + return to_assign(1, '操作失败,原因:'.$res); + + }else{ + + // 取出正常的商家 + $merchant = Merchant::where('status', 1)->column('mer_id, real_name'); + + // 区域模型 + $arealist = GeoArea::where('city_code', '510500')->select(); + + View::assign('editor', get_system_config('other','editor')); + View::assign('arealist', $arealist); + View::assign('merchant', $merchant); + View::assign('url', $this->url); + return view(); + } + } + + /** + * + * 编辑 + * + */ + public function edit() + { + $id = get_params("id"); + if(!$id) return to_assign(1, '非法操作!'); + + if (request()->isAjax()) { + + $params = get_params(); + + $data['id'] = $params['id']; // 当前ID + $data['user_id'] = $this->adminInfo['id']; // 操作用户ID + $data['name'] = $params['title']; // 团队名称 + $data['tel'] = $params['phone']; // 联系电话 + $data['mer_id_list'] = isset($params['mer_id']) ? json_encode($params['mer_id']) : null; // 已选商户 + $data['street_id'] = $params['street_id']; // 街道ID + $street = GeoStreet::where('street_id', $data['street_id'])->find(); // 街道数据 + $data['lng'] = $street['lng']; // 经度 + $data['lat'] = $street['lat']; // 纬度 + $area = $street->area; // 区数据 + $data['area_id'] = $area['area_id']; // 区县id + $city = $area->city; // 获取市级 + $data['address'] = $city['city_name'] . $area['area_name'] . $street['street_name']; // 实际地址 + $data['create_time'] = date('Y-m-d H:i:s'); + + // 数据更新 + $supplyChain = SupplyChain::with(['linkMerchant'])->find($data['id']); + $res = $supplyChain->update($data); + + // 获取关联数据一对一---曲线救国 + $linkMerchant = $supplyChain['linkMerchant']; + // $linkMerchantArr = $linkMerchant->column('id'); + + // 先删除关联数据-- 曲线救国 + $linkMerchant->delete(); + + // 关联商户状态 + if($data['mer_id_list']) + { + // 再重新将关联数据入库 + foreach ($params['mer_id'] as $v) { + + $dataLink = [ + 'eb_merchant_id' => $v, // 商户ID + 'user_id' => $data['user_id'], + 'create_time' => $data['create_time'], + ]; + + $supplyChain->linkMerchant()->save($dataLink); + } + } + + if ($res){ + return to_assign(0,'操作成功',['aid'=>$res]); + } + + return to_assign(1, '操作失败,原因:'.$res); + + }else{ + + $supplyChain = SupplyChain::with(['merchant', 'street', 'area'])->find($id); // 取出当前供应链数据 + + View::assign('detail', $supplyChain); + + // 取出正常的商家 + $merchant = Merchant::where('status', 1)->column('mer_id, real_name'); + // 区域模型 + $arealist = GeoArea::where('city_code', '510500')->select(); + + View::assign('arealist', $arealist); + View::assign('merchant', $merchant); + View::assign('url', $this->url); + return view(); + } + + } + + /** + * + * 删除 + * + */ + public function delete() + { + $id = get_params("id"); + if(!$id) return to_assign(1, '非法操作!'); + + $supplyChain = SupplyChain::with(['linkMerchant'])->find($id); + // 删除关联模型 + $res = $supplyChain->together(['linkMerchant'])->delete(); + + if ($res){ + return to_assign(0,'操作成功',['aid'=>$res]); + } + + return to_assign(1, '操作失败,原因:'.$res); + + } + +} \ No newline at end of file diff --git a/app/admin/model/EbStoreProduct.php b/app/admin/model/EbStoreProduct.php index 28c3804..b5a873b 100644 --- a/app/admin/model/EbStoreProduct.php +++ b/app/admin/model/EbStoreProduct.php @@ -1,6 +1,6 @@ hasOne(Merchant::class, 'mer_id', 'mer_id'); + } } \ No newline at end of file diff --git a/app/admin/model/Merchant.php b/app/admin/model/Merchant.php index 32cb06d..4368153 100644 --- a/app/admin/model/Merchant.php +++ b/app/admin/model/Merchant.php @@ -29,5 +29,24 @@ return $this->hasOneThrough(SupplyChainLinkMerchant::class, SupplyChain::class); } + /** + * + * 关联商户类型 + * + */ + public function merchantType() + { + return $this->hasOne(MerchantType::class, 'mer_type_id', 'type_id'); + } + + /** + * + * 关联商户类别 + * + */ + public function category() + { + return $this->hasOne(MerchantCategory::class, 'merchant_category_id', 'category_id'); + } } \ No newline at end of file diff --git a/app/admin/model/MerchantCategory.php b/app/admin/model/MerchantCategory.php new file mode 100644 index 0000000..b486efa --- /dev/null +++ b/app/admin/model/MerchantCategory.php @@ -0,0 +1,22 @@ +hasOne(EbStoreProduct::class, 'product_id', 'product_id'); + } + } \ No newline at end of file diff --git a/app/admin/view/product/classify/add.html b/app/admin/view/product/classify/add.html new file mode 100644 index 0000000..b4b9888 --- /dev/null +++ b/app/admin/view/product/classify/add.html @@ -0,0 +1,200 @@ +{extend name="common/base"/} +{block name="style"} + +{/block} + +{block name="body"} +
+

关联商户

+ + + + + + + + + + + + + + + + + + + + + + + + +
选择商户 +
+ +
+
+
+ +
+
+
+
+
+
+
+ +
+ +
+
+
+
+ +
+ +
+
+
请选择所在地址* +
+ +
+
+ +
+
+
+
+
+
+ + +
+ +
+{/block} + + + +{block name="script"} + + + +{/block} + \ No newline at end of file diff --git a/app/admin/view/product/classify/edit.html b/app/admin/view/product/classify/edit.html new file mode 100644 index 0000000..2ebf4e4 --- /dev/null +++ b/app/admin/view/product/classify/edit.html @@ -0,0 +1,188 @@ +{extend name="common/base"/} +{block name="style"} + +{/block} + +{block name="body"} +
+ +

编辑

+ + + + + + + + + + + + + + + + + + +
选择商户 +
+ +
+
+
+
+
+ +
+ +
+
+
+
+ +
+ + +
+
+
+
+ +
+ +
+
+
+
+ +
+ +
+
+
+
+ + +
+
+{/block} + + + +{block name="script"} + + + + +{/block} + \ No newline at end of file diff --git a/app/admin/view/product/classify/index.html b/app/admin/view/product/classify/index.html new file mode 100644 index 0000000..ea8a104 --- /dev/null +++ b/app/admin/view/product/classify/index.html @@ -0,0 +1,185 @@ +{extend name="common/base"/} + +{block name="body"} + +
+
+
+ +
+ +
+
+
+ + + + + + + + +{/block} + + + +{block name="script"} + +{/block} + \ No newline at end of file diff --git a/app/admin/view/product/comment/add.html b/app/admin/view/product/comment/add.html new file mode 100644 index 0000000..b4b9888 --- /dev/null +++ b/app/admin/view/product/comment/add.html @@ -0,0 +1,200 @@ +{extend name="common/base"/} +{block name="style"} + +{/block} + +{block name="body"} +
+

关联商户

+ + + + + + + + + + + + + + + + + + + + + + + + +
选择商户 +
+ +
+
+
+ +
+
+
+
+
+
+
+ +
+ +
+
+
+
+ +
+ +
+
+
请选择所在地址* +
+ +
+
+ +
+
+
+
+
+
+ + +
+ +
+{/block} + + + +{block name="script"} + + + +{/block} + \ No newline at end of file diff --git a/app/admin/view/product/comment/edit.html b/app/admin/view/product/comment/edit.html new file mode 100644 index 0000000..2ebf4e4 --- /dev/null +++ b/app/admin/view/product/comment/edit.html @@ -0,0 +1,188 @@ +{extend name="common/base"/} +{block name="style"} + +{/block} + +{block name="body"} +
+ +

编辑

+ + + + + + + + + + + + + + + + + + +
选择商户 +
+ +
+
+
+
+
+ +
+ +
+
+
+
+ +
+ + +
+
+
+
+ +
+ +
+
+
+
+ +
+ +
+
+
+
+ + +
+
+{/block} + + + +{block name="script"} + + + + +{/block} + \ No newline at end of file diff --git a/app/admin/view/product/comment/index.html b/app/admin/view/product/comment/index.html new file mode 100644 index 0000000..b369315 --- /dev/null +++ b/app/admin/view/product/comment/index.html @@ -0,0 +1,200 @@ +{extend name="common/base"/} + +{block name="body"} + +
+
+
+ +
+ +
+
+
+ + + + + + + + +{/block} + + + +{block name="script"} + +{/block} + \ No newline at end of file diff --git a/app/admin/view/product/product/add.html b/app/admin/view/product/product/add.html new file mode 100644 index 0000000..b4b9888 --- /dev/null +++ b/app/admin/view/product/product/add.html @@ -0,0 +1,200 @@ +{extend name="common/base"/} +{block name="style"} + +{/block} + +{block name="body"} +
+

关联商户

+ + + + + + + + + + + + + + + + + + + + + + + + +
选择商户 +
+ +
+
+
+ +
+
+
+
+
+
+
+ +
+ +
+
+
+
+ +
+ +
+
+
请选择所在地址* +
+ +
+
+ +
+
+
+
+
+
+ + +
+ +
+{/block} + + + +{block name="script"} + + + +{/block} + \ No newline at end of file diff --git a/app/admin/view/product/product/edit.html b/app/admin/view/product/product/edit.html new file mode 100644 index 0000000..2ebf4e4 --- /dev/null +++ b/app/admin/view/product/product/edit.html @@ -0,0 +1,188 @@ +{extend name="common/base"/} +{block name="style"} + +{/block} + +{block name="body"} +
+ +

编辑

+ + + + + + + + + + + + + + + + + + +
选择商户 +
+ +
+
+
+
+
+ +
+ +
+
+
+
+ +
+ + +
+
+
+
+ +
+ +
+
+
+
+ +
+ +
+
+
+
+ + +
+
+{/block} + + + +{block name="script"} + + + + +{/block} + \ No newline at end of file diff --git a/app/admin/view/product/product/index.html b/app/admin/view/product/product/index.html new file mode 100644 index 0000000..57343c8 --- /dev/null +++ b/app/admin/view/product/product/index.html @@ -0,0 +1,236 @@ +{extend name="common/base"/} + +{block name="body"} + +
+
+
+ +
+ +
+
+
+ + + + + + + + +{/block} + + + +{block name="script"} + +{/block} + \ No newline at end of file