From f311e89370aa0161bb933647778cda49d7fc7228 Mon Sep 17 00:00:00 2001 From: monanxiao Date: Mon, 6 Mar 2023 17:31:12 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E5=95=86=E5=93=81=E5=88=86?= =?UTF-8?q?=E7=B1=BB=E3=80=81=E5=93=81=E7=89=8C=E5=88=86=E7=B1=BB=E3=80=81?= =?UTF-8?q?=E5=93=81=E7=89=8C=E7=AE=A1=E7=90=86=E3=80=81=E4=BF=9D=E9=9A=9C?= =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E3=80=81=E5=95=86=E5=93=81=E6=A0=87=E7=AD=BE?= =?UTF-8?q?=E7=AD=89=E5=90=8E=E5=8F=B0=E9=9B=86=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/common.php | 32 ++- app/admin/controller/product/Band.php | 208 +++++++++++++++++ .../controller/product/BrandClassify.php | 216 ++++++++++++++++++ app/admin/controller/product/Classify.php | 130 ++++------- app/admin/controller/product/Guarantee.php | 196 ++++++++++++++++ app/admin/controller/product/Label.php | 100 ++------ app/admin/controller/product/MerSpecs.php | 216 ++++++++++++++++++ .../controller/product/PriceDescription.php | 216 ++++++++++++++++++ app/admin/controller/product/Specs.php | 216 ++++++++++++++++++ app/admin/model/Guarantee.php | 23 ++ app/admin/model/StoreBrand.php | 32 +++ app/admin/model/StoreBrandCategory.php | 33 +++ app/admin/model/StoreCategory.php | 8 + app/admin/view/product/Label/add.html | 38 +-- app/admin/view/product/Label/edit.html | 129 ++--------- app/admin/view/product/Label/index.html | 75 ++---- app/admin/view/product/band/add.html | 167 ++++++++++++++ app/admin/view/product/band/edit.html | 165 +++++++++++++ app/admin/view/product/band/index.html | 152 ++++++++++++ .../view/product/brand_classify/add.html | 122 ++++++++++ .../view/product/brand_classify/edit.html | 119 ++++++++++ .../view/product/brand_classify/index.html | 126 ++++++++++ app/admin/view/product/classify/add.html | 129 ++++------- app/admin/view/product/classify/edit.html | 112 +++------ app/admin/view/product/classify/index.html | 17 +- app/admin/view/product/guarantee/add.html | 129 +++++++++++ app/admin/view/product/guarantee/edit.html | 122 ++++++++++ app/admin/view/product/guarantee/index.html | 182 +++++++++++++++ app/admin/view/product/mer_specs/add.html | 167 ++++++++++++++ app/admin/view/product/mer_specs/edit.html | 165 +++++++++++++ app/admin/view/product/mer_specs/index.html | 152 ++++++++++++ .../view/product/price_description/add.html | 167 ++++++++++++++ .../view/product/price_description/edit.html | 165 +++++++++++++ .../view/product/price_description/index.html | 152 ++++++++++++ app/admin/view/product/specs/add.html | 167 ++++++++++++++ app/admin/view/product/specs/edit.html | 165 +++++++++++++ app/admin/view/product/specs/index.html | 152 ++++++++++++ 37 files changed, 4339 insertions(+), 523 deletions(-) create mode 100644 app/admin/controller/product/Band.php create mode 100644 app/admin/controller/product/BrandClassify.php create mode 100644 app/admin/controller/product/Guarantee.php create mode 100644 app/admin/controller/product/MerSpecs.php create mode 100644 app/admin/controller/product/PriceDescription.php create mode 100644 app/admin/controller/product/Specs.php create mode 100644 app/admin/model/Guarantee.php create mode 100644 app/admin/model/StoreBrand.php create mode 100644 app/admin/model/StoreBrandCategory.php create mode 100644 app/admin/view/product/band/add.html create mode 100644 app/admin/view/product/band/edit.html create mode 100644 app/admin/view/product/band/index.html create mode 100644 app/admin/view/product/brand_classify/add.html create mode 100644 app/admin/view/product/brand_classify/edit.html create mode 100644 app/admin/view/product/brand_classify/index.html create mode 100644 app/admin/view/product/guarantee/add.html create mode 100644 app/admin/view/product/guarantee/edit.html create mode 100644 app/admin/view/product/guarantee/index.html create mode 100644 app/admin/view/product/mer_specs/add.html create mode 100644 app/admin/view/product/mer_specs/edit.html create mode 100644 app/admin/view/product/mer_specs/index.html create mode 100644 app/admin/view/product/price_description/add.html create mode 100644 app/admin/view/product/price_description/edit.html create mode 100644 app/admin/view/product/price_description/index.html create mode 100644 app/admin/view/product/specs/add.html create mode 100644 app/admin/view/product/specs/edit.html create mode 100644 app/admin/view/product/specs/index.html diff --git a/app/admin/common.php b/app/admin/common.php index fae15ee..bf740b5 100644 --- a/app/admin/common.php +++ b/app/admin/common.php @@ -10,6 +10,7 @@ use think\facade\Request; use think\facade\Cache; use think\facade\Db; use app\admin\model\StoreCategory; // 商品分类模型 +use app\admin\model\StoreBrandCategory; // 商品品牌列表模型 //获取后台模块当前登录用户的信息 function get_login_admin($key = "") @@ -110,7 +111,36 @@ function set_recursion($result, $pid = 0, $level=-1) return $list; } -//读取商品分类节点列表 +//读取商品品牌节点列表 +function get_band_calss() +{ + $result = StoreBrandCategory::where('pid', 0)->order('sort desc')->select()->toArray(); + return $result; +} + +//递归排序,用于分类选择 +function set_band_recursion($result, $pid = 0, $level=-1) +{ + /*记录排序后的类别数组*/ + static $list = array(); + static $space = ['','├─','§§├─','§§§§├─','§§§§§§├─']; + $level++; + + foreach ($result as $k => $v) { + if ($v['pid'] == $pid) { + if ($pid != 0) { + $v['cate_name'] = $space[$level] . $v['cate_name']; + } + /*将该类别的数据放入list中*/ + $list[] = $v; + set_band_recursion($result, $v['store_brand_category_id'],$level); + } + } + + return $list; +} + +//读取商品品牌分类节点列表 function get_product_calss() { $result = StoreCategory::select()->toArray(); diff --git a/app/admin/controller/product/Band.php b/app/admin/controller/product/Band.php new file mode 100644 index 0000000..f3444a8 --- /dev/null +++ b/app/admin/controller/product/Band.php @@ -0,0 +1,208 @@ +adminInfo = get_login_admin(); + $this->category_id=354; + $this->url=[ + '/admin/product.band/index?category_id='.$this->category_id, + '/admin/product.band/add', + '/admin/product.band/edit', + '/admin/product.band/del', + '/admin/product.band/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 = StoreBrand::where($where)->count(); + + $list = StoreBrand::order('sort desc, brand_id desc')->select(); + + View::assign('url', $this->url); + View::assign('list', $list); + + $result = ['total' => $total, 'data' => $list]; + + return table_assign(0, '', $result); + + }else{ + + $list = StoreBrand::select(); + + View::assign('url', $this->url); + View::assign('list', $list); + return view(); + } + } + + /** + * + * 新增 + * + */ + public function add() + { + if (request()->isAjax()) { + + $params = get_params(); + + $data['brand_name'] = $params['brand_name']; // 品牌名称 + $data['is_show'] = isset($params['is_show']); // 状态 + $data['brand_category_id'] = $params['brand_category_id']; // 所属ID + $data['sort'] = $params['sort']; // 排序 + $data['create_time'] = date('Y-m-d H:i:s'); + + // 数据入库 + $res = StoreBrand::create($data); + + if ($res){ + return to_assign(0,'操作成功',['aid'=>$res]); + } + + return to_assign(1, '操作失败,原因:'.$res); + + }else{ + + $storeBrandCategory = StoreBrandCategory::order('sort desc') + ->where('pid', 0) + ->where('is_show', 1) + ->select(); + + View::assign('storeBrandCategory', $storeBrandCategory); + View::assign('editor', get_system_config('other','editor')); + 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['brand_name'] = $params['brand_name']; // 品牌名称 + $data['is_show'] = isset($params['is_show']); // 状态 + $data['brand_category_id'] = $params['brand_category_id']; // 所属ID + $data['sort'] = $params['sort']; // 排序 + + // 数据更新 + $res = StoreBrand::where('brand_id', $params['id'])->update($data); + + if ($res){ + return to_assign(0,'更新成功',['aid'=>$res]); + } + + return to_assign(1, '更新失败,原因:'.$res); + + }else{ + + $supplyChain = StoreBrand::with(['storeBrandCategory'])->find($id); // 取出当前品牌数据 + + $storeBrandCategory = StoreBrandCategory::order('sort desc') + ->where('pid', 0) + ->where('is_show', 1) + ->select(); + + View::assign('storeBrandCategory', $storeBrandCategory); + View::assign('detail', $supplyChain); + View::assign('url', $this->url); + return view(); + } + + } + + /** + * + * 删除 + * + */ + public function del() + { + $id = get_params("id"); + + if(!$id) return to_assign(1, '非法操作!'); + + $res = StoreBrand::where('brand_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/BrandClassify.php b/app/admin/controller/product/BrandClassify.php new file mode 100644 index 0000000..35978c5 --- /dev/null +++ b/app/admin/controller/product/BrandClassify.php @@ -0,0 +1,216 @@ +adminInfo = get_login_admin(); + $this->category_id=354; + $this->url=[ + '/admin/product.brandClassify/index?category_id='.$this->category_id, + '/admin/product.brandClassify/add', + '/admin/product.brandClassify/edit', + '/admin/product.brandClassify/del', + '/admin/product.brandClassify/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 = StoreBrandCategory::where($where)->count(); + + $list = StoreBrandCategory::order('sort desc')->select(); + + View::assign('url', $this->url); + View::assign('list', $list); + + $result = ['total' => $total, 'data' => $list]; + + return table_assign(0, '', $result); + + }else{ + + $list = StoreBrandCategory::select(); + + View::assign('url', $this->url); + View::assign('list', $list); + return view(); + } + } + + /** + * + * 新增 + * + */ + public function add() + { + if (request()->isAjax()) { + + $params = get_params(); + + $data['cate_name'] = $params['cate_name']; // 分类名称 + $data['is_show'] = isset($params['is_show']) && $params['is_show'] == 'on'? 1:0; // 是否显示 + $data['pid'] = $params['pid']; // 上级分类 + $data['sort'] = $params['sort']; // 排序 + $data['create_time'] = date('Y-m-d H:i:s'); + + // 数据入库 + $res = StoreBrandCategory::create($data); + + if ($res){ + return to_assign(0,'操作成功',['aid'=>$res]); + } + + return to_assign(1, '操作失败,原因:'.$res); + + }else{ + + View::assign('editor', get_system_config('other','editor')); + 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['cate_name'] = $params['cate_name']; // 分类名称 + $data['is_show'] = isset($params['is_show']) && $params['is_show'] == 'on'? 1:0; // 是否显示 + $data['pid'] = $params['pid']; // 上级分类 + $data['sort'] = $params['sort']; // 排序 + $data['create_time'] = date('Y-m-d H:i:s'); + + // 数据更新 + $res = StoreBrandCategory::where('store_brand_category_id', $params['id'])->update($data); + + if ($res){ + return to_assign(0,'更新成功',['aid'=>$res]); + } + + return to_assign(1, '更新失败,原因:'.$res); + + }else{ + + $storeBrandCtegory = StoreBrandCategory::find($id); // 取出当前品牌分类信息 + + View::assign('detail', $storeBrandCtegory); + View::assign('url', $this->url); + return view(); + } + + } + + /** + * + * 删除 + * + */ + public function del() + { + $id = get_params("id"); + + if(!$id) return to_assign(1, '非法操作!'); + + // 验证下面是否有子分类 + if(StoreBrandCategory::where('pid', $id)->count()) + { + return to_assign(1, '请先删除子分类!'); + } + + $res = StoreBrandCategory::where('store_brand_category_id', $id)->delete(); + + if ($res){ + return to_assign(0,'操作成功',['aid'=>$res]); + } + + return to_assign(1, '操作失败,原因:'.$res); + + } + + /** + * + * 子分类 + * + */ + public function street($pcode) + { + $storeBrandCategory = StoreBrandCategory::order('sort desc') + ->where('is_show', 1) + ->where('pid', $pcode) + ->select(); + + return json($storeBrandCategory); + } + +} \ No newline at end of file diff --git a/app/admin/controller/product/Classify.php b/app/admin/controller/product/Classify.php index cd8cf4c..343e280 100644 --- a/app/admin/controller/product/Classify.php +++ b/app/admin/controller/product/Classify.php @@ -71,10 +71,10 @@ class Classify extends BaseController } } - $total = StoreCategory::where('mer_id', 0)->where($where)->count(); + $total = StoreCategory::where($where)->count(); // $list = StoreCategory::with(['merchant', 'street', 'area'])->order('id desc')->select(); - $list = StoreCategory::where('mer_id', 0)->order('store_category_id desc')->select(); + $list = StoreCategory::order('store_category_id desc')->select(); View::assign('url', $this->url); View::assign('list', $list); @@ -85,7 +85,7 @@ class Classify extends BaseController }else{ - $list = StoreCategory::where('mer_id', 0)->select(); + $list = StoreCategory::select(); View::assign('url', $this->url); View::assign('list', $list); @@ -103,37 +103,25 @@ class Classify extends BaseController $param = get_params(); if (request()->isAjax()) { - $param['src'] = preg_replace('# #','',$param['src']); - if ($param['id'] > 0) { - try { - validate(RuleCheck::class)->scene('edit')->check($param); - } catch (ValidateException $e) { - // 验证失败 输出错误信息 - return to_assign(1, $e->getError()); - } - Db::name('AdminRule')->strict(false)->field(true)->update($param); - add_log('edit', $param['id'], $param); - } else { - try { - validate(RuleCheck::class)->scene('add')->check($param); - } catch (ValidateException $e) { - // 验证失败 输出错误信息 - return to_assign(1, $e->getError()); - } - $param['create_time'] = time(); - $rid = Db::name('AdminRule')->strict(false)->field(true)->insertGetId($param); - //自动为系统所有者管理组分配新增的节点 - $group = Db::name('AdminGroup')->find(1); - if (!empty($group)) { - $newGroup['id'] = 1; - $newGroup['rules'] = $group['rules'] . ',' . $rid; - Db::name('AdminGroup')->strict(false)->field(true)->update($newGroup); - add_log('add', $rid, $param); - } + + $params = get_params(); + + $data['cate_name'] = $params['cate_name']; // 分类名称 + $data['is_show'] = isset($params['is_show']) && $params['is_show'] == 'on'? 1:0; // 是否显示 + $data['pic'] = $params['pic']; // 图标 + $data['pid'] = $params['pid']; // 上级分类 + $data['sort'] = $params['sort']; // 排序 + $data['create_time'] = date('Y-m-d H:i:s'); + + // 数据入库 + $res = StoreCategory::create($data); + + if ($res){ + return to_assign(0,'操作成功',['aid'=>$res]); } - // 删除后台节点缓存 - clear_cache('adminRules'); - return to_assign(); + + return to_assign(1, '操作失败,原因:'.$res); + } else { $id = isset($param['id']) ? $param['id'] : 0; @@ -144,7 +132,7 @@ class Classify extends BaseController View::assign('detail', $detail); } - $storeCategoryList = StoreCategory::select(); + $storeCategoryList = StoreCategory::order('store_category_id desc')->where('pid', 0)->select(); View::assign('storeCategoryList', $storeCategoryList); View::assign('url', $this->url); @@ -170,47 +158,14 @@ class Classify extends BaseController $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'); - + $data['cate_name'] = $params['cate_name']; // 分类名称 + $data['is_show'] = isset($params['is_show']) && $params['is_show'] == 'on'? 1:0; // 是否显示 + $data['pic'] = $params['pic']; // 图标 + $data['pid'] = $params['pid']; // 上级分类 + $data['sort'] = $params['sort']; // 排序 + // 数据更新 - $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); - } - } + $res = StoreCategory::where('store_category_id', $params['id'])->update($data); if ($res){ return to_assign(0,'操作成功',['aid'=>$res]); @@ -220,17 +175,12 @@ class Classify extends BaseController }else{ - $category = StoreCategory::find($id); // 取出当前供应链数据 - + $category = StoreCategory::with(['storeCategory'])->find($id); // 取出当前供应链数据 + $storeCategoryList = StoreCategory::order('store_category_id desc')->where('pid', 0)->select(); + + View::assign('storeCategoryList', $storeCategoryList); 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(); } @@ -259,4 +209,18 @@ class Classify extends BaseController } + /** + * + * 获取子分类 + * + */ + public function street($pcode) + { + $storeCategory = StoreCategory::order('sort desc') + ->where('is_show', 1) + ->where('pid', $pcode) + ->select(); + + return json($storeCategory); + } } \ No newline at end of file diff --git a/app/admin/controller/product/Guarantee.php b/app/admin/controller/product/Guarantee.php new file mode 100644 index 0000000..58c92b3 --- /dev/null +++ b/app/admin/controller/product/Guarantee.php @@ -0,0 +1,196 @@ +adminInfo = get_login_admin(); + $this->category_id=354; + $this->url=[ + '/admin/product.guarantee/index?category_id='.$this->category_id, + '/admin/product.guarantee/add', + '/admin/product.guarantee/edit', + '/admin/product.guarantee/del', + '/admin/product.guarantee/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 = GuaranteeModel::where($where)->count(); + + $list = GuaranteeModel::order('guarantee_id desc')->select(); + + View::assign('url', $this->url); + View::assign('list', $list); + + $result = ['total' => $total, 'data' => $list]; + + return table_assign(0, '', $result); + + }else{ + + $list = GuaranteeModel::select(); + + View::assign('url', $this->url); + View::assign('list', $list); + return view(); + } + } + + /** + * + * 新增 + * + */ + public function add() + { + if (request()->isAjax()) { + + $params = get_params(); + + $data['guarantee_name'] = $params['guarantee_name']; // 标签名 + $data['status'] = isset($params['status']) && $params['status'] == 'on'? 1:0; // 状态 + $data['guarantee_info'] = $params['guarantee_info']; // 说明 + $data['image'] = $params['image']; // 说明 + $data['sort'] = $params['sort']; // 排序 + $data['create_time'] = date('Y-m-d H:i:s'); + + // 数据入库 + $res = GuaranteeModel::create($data); + + if ($res){ + return to_assign(0,'操作成功',['aid'=>$res]); + } + + return to_assign(1, '操作失败,原因:'.$res); + + }else{ + + View::assign('editor', get_system_config('other','editor')); + 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['guarantee_name'] = $params['guarantee_name']; // 标签名 + $data['status'] = isset($params['status']) && $params['status'] == 'on'? 1:0; // 状态 + $data['guarantee_info'] = $params['guarantee_info']; // 说明 + $data['image'] = $params['image']; // 说明 + $data['sort'] = $params['sort']; // 排序 + $data['update_time'] = date('Y-m-d H:i:s'); + + // 数据更新 + $res = GuaranteeModel::where('guarantee_id', $params['id'])->update($data); + + if ($res){ + return to_assign(0,'更新成功',['aid'=>$res]); + } + + return to_assign(1, '更新失败,原因:'.$res); + + }else{ + + $supplyChain = GuaranteeModel::find($id); // 取出当前保障服务数据 + + View::assign('detail', $supplyChain); + View::assign('url', $this->url); + return view(); + } + + } + + /** + * + * 删除 + * + */ + public function del() + { + $id = get_params("id"); + + if(!$id) return to_assign(1, '非法操作!'); + + $res = GuaranteeModel::where('guarantee_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/Label.php b/app/admin/controller/product/Label.php index e2596d6..e2643a0 100644 --- a/app/admin/controller/product/Label.php +++ b/app/admin/controller/product/Label.php @@ -107,35 +107,14 @@ class Label extends BaseController $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['label_name'] = $params['label_name']; // 标签名 + $data['status'] = isset($params['status']) && $params['status'] == 'on'? 1:0; // 状态 + $data['info'] = $params['info']; // 说明 + $data['sort'] = $params['sort']; // 排序 $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); // 插入关联数据 - } + $res = StoreProductLabel::create($data); if ($res){ return to_assign(0,'操作成功',['aid'=>$res]); @@ -145,15 +124,7 @@ class Label extends BaseController }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(); } @@ -173,67 +144,26 @@ class Label extends BaseController $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['label_name'] = $params['label_name']; // 标签名 + $data['status'] = isset($params['status']) && $params['status'] == 'on'? 1:0; // 状态 + $data['info'] = $params['info']; // 说明 + $data['sort'] = $params['sort']; // 排序 $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); - } - } + $res = StoreProductLabel::where('product_label_id', $params['id'])->update($data); if ($res){ - return to_assign(0,'操作成功',['aid'=>$res]); + return to_assign(0,'更新成功',['aid'=>$res]); } - return to_assign(1, '操作失败,原因:'.$res); + return to_assign(1, '更新失败,原因:'.$res); }else{ - $supplyChain = SupplyChain::with(['merchant', 'street', 'area'])->find($id); // 取出当前供应链数据 + $supplyChain = StoreProductLabel::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(); } @@ -251,7 +181,7 @@ class Label extends BaseController if(!$id) return to_assign(1, '非法操作!'); - $res = StoreProductReply::where('reply_id', $id)->delete(); + $res = StoreProductLabel::where('product_label_id', $id)->delete(); if ($res){ return to_assign(0,'操作成功',['aid'=>$res]); diff --git a/app/admin/controller/product/MerSpecs.php b/app/admin/controller/product/MerSpecs.php new file mode 100644 index 0000000..d65079e --- /dev/null +++ b/app/admin/controller/product/MerSpecs.php @@ -0,0 +1,216 @@ +adminInfo = get_login_admin(); + $this->category_id=354; + $this->url=[ + '/admin/product.priceDescription/index?category_id='.$this->category_id, + '/admin/product.priceDescription/add', + '/admin/product.priceDescription/edit', + '/admin/product.priceDescription/del', + '/admin/product.priceDescription/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 = StoreBrandCategory::where($where)->count(); + + $list = StoreBrandCategory::order('sort desc')->select(); + + View::assign('url', $this->url); + View::assign('list', $list); + + $result = ['total' => $total, 'data' => $list]; + + return table_assign(0, '', $result); + + }else{ + + $list = StoreBrandCategory::select(); + + View::assign('url', $this->url); + View::assign('list', $list); + return view(); + } + } + + /** + * + * 新增 + * + */ + public function add() + { + if (request()->isAjax()) { + + $params = get_params(); + + $data['cate_name'] = $params['cate_name']; // 分类名称 + $data['is_show'] = isset($params['is_show']) && $params['is_show'] == 'on'? 1:0; // 是否显示 + $data['pid'] = $params['pid']; // 上级分类 + $data['sort'] = $params['sort']; // 排序 + $data['create_time'] = date('Y-m-d H:i:s'); + + // 数据入库 + $res = StoreBrandCategory::create($data); + + if ($res){ + return to_assign(0,'操作成功',['aid'=>$res]); + } + + return to_assign(1, '操作失败,原因:'.$res); + + }else{ + + View::assign('editor', get_system_config('other','editor')); + 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['cate_name'] = $params['cate_name']; // 分类名称 + $data['is_show'] = isset($params['is_show']) && $params['is_show'] == 'on'? 1:0; // 是否显示 + $data['pid'] = $params['pid']; // 上级分类 + $data['sort'] = $params['sort']; // 排序 + $data['create_time'] = date('Y-m-d H:i:s'); + + // 数据更新 + $res = StoreBrandCategory::where('store_brand_category_id', $params['id'])->update($data); + + if ($res){ + return to_assign(0,'更新成功',['aid'=>$res]); + } + + return to_assign(1, '更新失败,原因:'.$res); + + }else{ + + $storeBrandCtegory = StoreBrandCategory::find($id); // 取出当前品牌分类信息 + + View::assign('detail', $storeBrandCtegory); + View::assign('url', $this->url); + return view(); + } + + } + + /** + * + * 删除 + * + */ + public function del() + { + $id = get_params("id"); + + if(!$id) return to_assign(1, '非法操作!'); + + // 验证下面是否有子分类 + if(StoreBrandCategory::where('pid', $id)->count()) + { + return to_assign(1, '请先删除子分类!'); + } + + $res = StoreBrandCategory::where('store_brand_category_id', $id)->delete(); + + if ($res){ + return to_assign(0,'操作成功',['aid'=>$res]); + } + + return to_assign(1, '操作失败,原因:'.$res); + + } + + /** + * + * 子分类 + * + */ + public function street($pcode) + { + $storeBrandCategory = StoreBrandCategory::order('sort desc') + ->where('is_show', 1) + ->where('pid', $pcode) + ->select(); + + return json($storeBrandCategory); + } + +} \ No newline at end of file diff --git a/app/admin/controller/product/PriceDescription.php b/app/admin/controller/product/PriceDescription.php new file mode 100644 index 0000000..e298bdf --- /dev/null +++ b/app/admin/controller/product/PriceDescription.php @@ -0,0 +1,216 @@ +adminInfo = get_login_admin(); + $this->category_id=354; + $this->url=[ + '/admin/product.priceDescription/index?category_id='.$this->category_id, + '/admin/product.priceDescription/add', + '/admin/product.priceDescription/edit', + '/admin/product.priceDescription/del', + '/admin/product.priceDescription/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 = StoreBrandCategory::where($where)->count(); + + $list = StoreBrandCategory::order('sort desc')->select(); + + View::assign('url', $this->url); + View::assign('list', $list); + + $result = ['total' => $total, 'data' => $list]; + + return table_assign(0, '', $result); + + }else{ + + $list = StoreBrandCategory::select(); + + View::assign('url', $this->url); + View::assign('list', $list); + return view(); + } + } + + /** + * + * 新增 + * + */ + public function add() + { + if (request()->isAjax()) { + + $params = get_params(); + + $data['cate_name'] = $params['cate_name']; // 分类名称 + $data['is_show'] = isset($params['is_show']) && $params['is_show'] == 'on'? 1:0; // 是否显示 + $data['pid'] = $params['pid']; // 上级分类 + $data['sort'] = $params['sort']; // 排序 + $data['create_time'] = date('Y-m-d H:i:s'); + + // 数据入库 + $res = StoreBrandCategory::create($data); + + if ($res){ + return to_assign(0,'操作成功',['aid'=>$res]); + } + + return to_assign(1, '操作失败,原因:'.$res); + + }else{ + + View::assign('editor', get_system_config('other','editor')); + 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['cate_name'] = $params['cate_name']; // 分类名称 + $data['is_show'] = isset($params['is_show']) && $params['is_show'] == 'on'? 1:0; // 是否显示 + $data['pid'] = $params['pid']; // 上级分类 + $data['sort'] = $params['sort']; // 排序 + $data['create_time'] = date('Y-m-d H:i:s'); + + // 数据更新 + $res = StoreBrandCategory::where('store_brand_category_id', $params['id'])->update($data); + + if ($res){ + return to_assign(0,'更新成功',['aid'=>$res]); + } + + return to_assign(1, '更新失败,原因:'.$res); + + }else{ + + $storeBrandCtegory = StoreBrandCategory::find($id); // 取出当前品牌分类信息 + + View::assign('detail', $storeBrandCtegory); + View::assign('url', $this->url); + return view(); + } + + } + + /** + * + * 删除 + * + */ + public function del() + { + $id = get_params("id"); + + if(!$id) return to_assign(1, '非法操作!'); + + // 验证下面是否有子分类 + if(StoreBrandCategory::where('pid', $id)->count()) + { + return to_assign(1, '请先删除子分类!'); + } + + $res = StoreBrandCategory::where('store_brand_category_id', $id)->delete(); + + if ($res){ + return to_assign(0,'操作成功',['aid'=>$res]); + } + + return to_assign(1, '操作失败,原因:'.$res); + + } + + /** + * + * 子分类 + * + */ + public function street($pcode) + { + $storeBrandCategory = StoreBrandCategory::order('sort desc') + ->where('is_show', 1) + ->where('pid', $pcode) + ->select(); + + return json($storeBrandCategory); + } + +} \ No newline at end of file diff --git a/app/admin/controller/product/Specs.php b/app/admin/controller/product/Specs.php new file mode 100644 index 0000000..c421474 --- /dev/null +++ b/app/admin/controller/product/Specs.php @@ -0,0 +1,216 @@ +adminInfo = get_login_admin(); + $this->category_id=354; + $this->url=[ + '/admin/product.priceDescription/index?category_id='.$this->category_id, + '/admin/product.priceDescription/add', + '/admin/product.priceDescription/edit', + '/admin/product.priceDescription/del', + '/admin/product.priceDescription/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 = StoreBrandCategory::where($where)->count(); + + $list = StoreBrandCategory::order('sort desc')->select(); + + View::assign('url', $this->url); + View::assign('list', $list); + + $result = ['total' => $total, 'data' => $list]; + + return table_assign(0, '', $result); + + }else{ + + $list = StoreBrandCategory::select(); + + View::assign('url', $this->url); + View::assign('list', $list); + return view(); + } + } + + /** + * + * 新增 + * + */ + public function add() + { + if (request()->isAjax()) { + + $params = get_params(); + + $data['cate_name'] = $params['cate_name']; // 分类名称 + $data['is_show'] = isset($params['is_show']) && $params['is_show'] == 'on'? 1:0; // 是否显示 + $data['pid'] = $params['pid']; // 上级分类 + $data['sort'] = $params['sort']; // 排序 + $data['create_time'] = date('Y-m-d H:i:s'); + + // 数据入库 + $res = StoreBrandCategory::create($data); + + if ($res){ + return to_assign(0,'操作成功',['aid'=>$res]); + } + + return to_assign(1, '操作失败,原因:'.$res); + + }else{ + + View::assign('editor', get_system_config('other','editor')); + 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['cate_name'] = $params['cate_name']; // 分类名称 + $data['is_show'] = isset($params['is_show']) && $params['is_show'] == 'on'? 1:0; // 是否显示 + $data['pid'] = $params['pid']; // 上级分类 + $data['sort'] = $params['sort']; // 排序 + $data['create_time'] = date('Y-m-d H:i:s'); + + // 数据更新 + $res = StoreBrandCategory::where('store_brand_category_id', $params['id'])->update($data); + + if ($res){ + return to_assign(0,'更新成功',['aid'=>$res]); + } + + return to_assign(1, '更新失败,原因:'.$res); + + }else{ + + $storeBrandCtegory = StoreBrandCategory::find($id); // 取出当前品牌分类信息 + + View::assign('detail', $storeBrandCtegory); + View::assign('url', $this->url); + return view(); + } + + } + + /** + * + * 删除 + * + */ + public function del() + { + $id = get_params("id"); + + if(!$id) return to_assign(1, '非法操作!'); + + // 验证下面是否有子分类 + if(StoreBrandCategory::where('pid', $id)->count()) + { + return to_assign(1, '请先删除子分类!'); + } + + $res = StoreBrandCategory::where('store_brand_category_id', $id)->delete(); + + if ($res){ + return to_assign(0,'操作成功',['aid'=>$res]); + } + + return to_assign(1, '操作失败,原因:'.$res); + + } + + /** + * + * 子分类 + * + */ + public function street($pcode) + { + $storeBrandCategory = StoreBrandCategory::order('sort desc') + ->where('is_show', 1) + ->where('pid', $pcode) + ->select(); + + return json($storeBrandCategory); + } + +} \ No newline at end of file diff --git a/app/admin/model/Guarantee.php b/app/admin/model/Guarantee.php new file mode 100644 index 0000000..22dd3b8 --- /dev/null +++ b/app/admin/model/Guarantee.php @@ -0,0 +1,23 @@ +hasOne(StoreBrandCategory::class, 'store_brand_category_id', 'brand_category_id'); + } + } \ No newline at end of file diff --git a/app/admin/model/StoreBrandCategory.php b/app/admin/model/StoreBrandCategory.php new file mode 100644 index 0000000..e9e09c2 --- /dev/null +++ b/app/admin/model/StoreBrandCategory.php @@ -0,0 +1,33 @@ +hasOne(StoreBrandCategory::class, 'store_brand_category_id', 'brand_category_id'); + } + + } \ No newline at end of file diff --git a/app/admin/model/StoreCategory.php b/app/admin/model/StoreCategory.php index 94ffe02..44807b6 100644 --- a/app/admin/model/StoreCategory.php +++ b/app/admin/model/StoreCategory.php @@ -19,4 +19,12 @@ protected $table = 'eb_store_category'; protected $pk = 'store_category_id'; + /** + * 关联商品分类 + */ + public function storeCategory() + { + return $this->hasOne(StoreCategory::class, 'store_category_id', 'pid'); + } + } \ No newline at end of file diff --git a/app/admin/view/product/Label/add.html b/app/admin/view/product/Label/add.html index d5e2d1e..4465a02 100644 --- a/app/admin/view/product/Label/add.html +++ b/app/admin/view/product/Label/add.html @@ -25,25 +25,34 @@ - + - + - - - + + + + +
姓名*标签名称* - +
职务*说明 - - 电话* - +
排序 + + +
+ +
+ +
+
+
@@ -74,9 +83,6 @@ //监听提交 form.on('submit(webform)', function (data) { - data.field.lng = $('.lng').text(); - data.field.lat = $('.lat').text(); - let callback = function (e) { layer.msg(e.msg); if (e.code == 0) { @@ -85,7 +91,7 @@ }, 1000); } } - tool.post('/admin/nk.areamanager/add', data.field, callback); + tool.post('/admin/product.label/add', data.field, callback); return false; }); diff --git a/app/admin/view/product/Label/edit.html b/app/admin/view/product/Label/edit.html index 2ebf4e4..cf1d79e 100644 --- a/app/admin/view/product/Label/edit.html +++ b/app/admin/view/product/Label/edit.html @@ -19,65 +19,38 @@ {block name="body"}
- +

编辑

- + - + - - + + - - - - - - +
选择商户标签名称* -
- -
+
-
+
说明 +
-
- -
- -
-
-
-
- -
- - +
排序 + + +
+ +
+
-
- -
- -
-
-
-
- -
- -
-
-
@@ -100,25 +73,7 @@ function gouguInit() { var form = layui.form, tool = layui.tool; - // 下拉选中事件 - form.on('select(merchant)', function(data){ - if(data.value == null || data.value == '') - { - return false; - } - - const title = $('#merchant' + data.value).text(); - const html = `` - + `
` + title + `
`; - $('#merchantList').append(html); - $("#merchant"+ data.value).remove(); - $(".layui-this").remove(); - }); - - form.on('select(merchantAddress)', function (data) { - street(data.value); - }); //监听提交 form.on('submit(webform)', function (data) { @@ -136,52 +91,6 @@ function gouguInit() { return false; }); - // 删除选中商户 - function merchantxz(env) - { - if($('#mer_id'+env).attr("checked") == 'checked') - { - $('#mer_id'+env).removeAttr('checked'); - $('#mer_id_style'+env).removeClass('layui-form-checked'); - }else{ - $('#mer_id'+env).attr('checked', 'checked'); - $('#mer_id_style'+env).addClass('layui-form-checked'); - } - - } - - var group_access = "{:session('gougu_admin')['group_access']}"; - - street("{$detail.store_category_id}"); - - function street (id) { - if(id == null || id == '') - { - return false; - } - - var demo1 = xmSelect.render({ - name: 'pid', - el: '#demo1', - prop: { - name: 'name', - value: 'id', - }, - data: [], - radio: true, - initValue: ['{$detail.pid}'], - disabled: group_access == 2 || group_access==4 ? true : false - }); - - $.get('/api/geo/street?pcode=' + id, function (result) { - - demo1.update({ - data: result.data - }); - }); - - } - } {/block} diff --git a/app/admin/view/product/Label/index.html b/app/admin/view/product/Label/index.html index 3bc5c51..f764ee9 100644 --- a/app/admin/view/product/Label/index.html +++ b/app/admin/view/product/Label/index.html @@ -34,9 +34,9 @@ - + {/if} {if {:auth_cache(session('gougu_admin')['id'],$url[3])}==true} 删除 {/if} @@ -63,78 +63,35 @@ [ { fixed: 'left', - field: 'reply_id', + field: 'product_label_id', title: '编号', align: 'center', width:80, },{ - field: 'store_name', - title: '商品名称', + field: 'label_name', + title: '分类名称', align: 'center', - width:120, - templet: function (d) - { - return d.product.store_name; - }, },{ - field: 'pic', - title: '商品图', + field: 'info', + title: '标签说明', align: 'center', - width:120, - templet: function (d) - { - var html = `
- -
`; - if(d.product.image) - { - html = `
- -
`; - } - return html; - }, - },{ - field: 'nickname', - title: '用户名称', - align: 'center', - width:150, - },{ - field: 'product_score', - title: '产品评分', - align: 'center', - width:150, - },{ - field: 'service_score', - title: '服务评分', - align: 'center', - width:150, - },{ - field: 'postage_score', - title: '物流评分', - align: 'center', - width:150, },{ field: 'sort', title: '排序', align: 'center', - width:150, },{ - field: 'comment', + field: 'status', title: '评价内容', align: 'center', - width:120, - },{ - field: 'merchant_reply_content', - title: '回复内容', - align: 'center', - width:120, + templet: function (d) + { + return d.status ? '显示' : '隐藏'; + }, },{ field: 'create_time', - title: '评论时间', + title: '创建时间', align: 'center', - width:150, },{ fixed: 'right', field: 'right', @@ -158,10 +115,10 @@ table.on('tool(article)', function(obj) { var data = obj.data; if (obj.event === 'read') { - tool.side('{$url[2]}?id='+obj.data.reply_id); + tool.side('{$url[2]}?id='+obj.data.product_label_id); } else if (obj.event === 'edit') { - tool.side('{$url[2]}?id='+obj.data.reply_id); + tool.side('{$url[2]}?id='+obj.data.product_label_id); } else if (obj.event === 'del') { layer.confirm('确定要删除该记录吗?', { @@ -174,7 +131,7 @@ obj.del(); } } - tool.delete('{$url[3]}', { id: data.reply_id }, callback); + tool.delete('{$url[3]}', { id: data.product_label_id }, callback); layer.close(index); }); } diff --git a/app/admin/view/product/band/add.html b/app/admin/view/product/band/add.html new file mode 100644 index 0000000..cd6974f --- /dev/null +++ b/app/admin/view/product/band/add.html @@ -0,0 +1,167 @@ +{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/band/edit.html b/app/admin/view/product/band/edit.html new file mode 100644 index 0000000..e764766 --- /dev/null +++ b/app/admin/view/product/band/edit.html @@ -0,0 +1,165 @@ +{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/band/index.html b/app/admin/view/product/band/index.html new file mode 100644 index 0000000..4c48c45 --- /dev/null +++ b/app/admin/view/product/band/index.html @@ -0,0 +1,152 @@ +{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/brand_classify/add.html b/app/admin/view/product/brand_classify/add.html new file mode 100644 index 0000000..d452070 --- /dev/null +++ b/app/admin/view/product/brand_classify/add.html @@ -0,0 +1,122 @@ +{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/brand_classify/edit.html b/app/admin/view/product/brand_classify/edit.html new file mode 100644 index 0000000..abc9fed --- /dev/null +++ b/app/admin/view/product/brand_classify/edit.html @@ -0,0 +1,119 @@ +{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/brand_classify/index.html b/app/admin/view/product/brand_classify/index.html new file mode 100644 index 0000000..d31b0cc --- /dev/null +++ b/app/admin/view/product/brand_classify/index.html @@ -0,0 +1,126 @@ +{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/classify/add.html b/app/admin/view/product/classify/add.html index fcc0291..8468a58 100644 --- a/app/admin/view/product/classify/add.html +++ b/app/admin/view/product/classify/add.html @@ -3,28 +3,41 @@ {block name="body"}

添加分类

- {if condition="$id eq 0"} - + + + + + + + + + + - - - - -
上级分类* - 上级分类* - + + {volist name=":set_product_recursion(get_product_calss())" id="v"} + {/volist} - -
分类名称* -
分类图片 +
+ +
+ + +
+
+
排序 @@ -35,80 +48,13 @@
- +
分类图片 -
- -
- - -
-
-
- {else/} - - - - - - - - - - - - - - - - - - - - - - - -
父级菜单/节点* - - - 左侧菜单显示* - - - -
菜单/节点名称* - - - 操作日志名称* - - -
菜单/节点URL - - 菜单排序 - -
菜单图标 - - [查看图标] -
- {/if} +
@@ -120,16 +66,30 @@ {block name="script"} + {/block} diff --git a/app/admin/view/product/classify/edit.html b/app/admin/view/product/classify/edit.html index 2ebf4e4..5e4547b 100644 --- a/app/admin/view/product/classify/edit.html +++ b/app/admin/view/product/classify/edit.html @@ -23,18 +23,20 @@

编辑

- - + - + - + + + + @@ -100,24 +106,19 @@ function gouguInit() { var form = layui.form, tool = layui.tool; - // 下拉选中事件 - form.on('select(merchant)', function(data){ - - if(data.value == null || data.value == '') - { - return false; + //上传缩略图 + var upload_thumb = layui.upload.render({ + elem: '#upload_btn_thumb', + url: '/admin/api/upload', + done: function (res) { + //如果上传失败 + if (res.code == 1) { + return layer.msg('上传失败'); + } + //上传成功 + $('#upload_box_thumb input').attr('value', res.data.filepath); + $('#upload_box_thumb img').attr('src', res.data.filepath); } - - const title = $('#merchant' + data.value).text(); - const html = `` - + `
` + title + `
`; - $('#merchantList').append(html); - $("#merchant"+ data.value).remove(); - $(".layui-this").remove(); - }); - - form.on('select(merchantAddress)', function (data) { - street(data.value); }); //监听提交 @@ -136,51 +137,6 @@ function gouguInit() { return false; }); - // 删除选中商户 - function merchantxz(env) - { - if($('#mer_id'+env).attr("checked") == 'checked') - { - $('#mer_id'+env).removeAttr('checked'); - $('#mer_id_style'+env).removeClass('layui-form-checked'); - }else{ - $('#mer_id'+env).attr('checked', 'checked'); - $('#mer_id_style'+env).addClass('layui-form-checked'); - } - - } - - var group_access = "{:session('gougu_admin')['group_access']}"; - - street("{$detail.store_category_id}"); - - function street (id) { - if(id == null || id == '') - { - return false; - } - - var demo1 = xmSelect.render({ - name: 'pid', - el: '#demo1', - prop: { - name: 'name', - value: 'id', - }, - data: [], - radio: true, - initValue: ['{$detail.pid}'], - disabled: group_access == 2 || group_access==4 ? true : false - }); - - $.get('/api/geo/street?pcode=' + id, function (result) { - - demo1.update({ - data: result.data - }); - }); - - } } diff --git a/app/admin/view/product/classify/index.html b/app/admin/view/product/classify/index.html index 4ff66ac..3d8837c 100644 --- a/app/admin/view/product/classify/index.html +++ b/app/admin/view/product/classify/index.html @@ -10,7 +10,7 @@
- +
选择商户 -
- -
+
上级分类* +
@@ -42,19 +44,23 @@
-
+
- +
+
分类图片
- +
- +
@@ -29,7 +29,7 @@ @@ -68,13 +68,16 @@ , treeShowName: 'cate_name'//以树形式显示的字段 , cols: [[ { field: 'store_category_id', width: 80, title: 'ID号', align: 'center' } - ,{field:'pic',title: '菜单图标',width: 80, align: 'center' ,templet: function(d){ - var html=''; + , { field: 'cate_name', title: '分类名称' } + ,{field:'pic',title: '分类图标',width: 80, align: 'center' ,templet: function(d){ + var html = ` + `; + if(d.pic) + { + html = ``; + } return html; }} - , { field: 'cate_name', title: '菜单/节点名称' } - // , { field: 'pid', title: '父ID', width: 80, align: 'center' } - // , { field: 'path', title: '父级', width: 80 } , { field: 'sort', title: '排序', align: 'center' } , { field: 'is_show', title: '是否显示', align: 'center', templet: function (d) { diff --git a/app/admin/view/product/guarantee/add.html b/app/admin/view/product/guarantee/add.html new file mode 100644 index 0000000..00125f1 --- /dev/null +++ b/app/admin/view/product/guarantee/add.html @@ -0,0 +1,129 @@ +{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/guarantee/edit.html b/app/admin/view/product/guarantee/edit.html new file mode 100644 index 0000000..a3386d0 --- /dev/null +++ b/app/admin/view/product/guarantee/edit.html @@ -0,0 +1,122 @@ +{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/guarantee/index.html b/app/admin/view/product/guarantee/index.html new file mode 100644 index 0000000..876d6e5 --- /dev/null +++ b/app/admin/view/product/guarantee/index.html @@ -0,0 +1,182 @@ +{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/mer_specs/add.html b/app/admin/view/product/mer_specs/add.html new file mode 100644 index 0000000..cd6974f --- /dev/null +++ b/app/admin/view/product/mer_specs/add.html @@ -0,0 +1,167 @@ +{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/mer_specs/edit.html b/app/admin/view/product/mer_specs/edit.html new file mode 100644 index 0000000..e764766 --- /dev/null +++ b/app/admin/view/product/mer_specs/edit.html @@ -0,0 +1,165 @@ +{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/mer_specs/index.html b/app/admin/view/product/mer_specs/index.html new file mode 100644 index 0000000..4c48c45 --- /dev/null +++ b/app/admin/view/product/mer_specs/index.html @@ -0,0 +1,152 @@ +{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/price_description/add.html b/app/admin/view/product/price_description/add.html new file mode 100644 index 0000000..cd6974f --- /dev/null +++ b/app/admin/view/product/price_description/add.html @@ -0,0 +1,167 @@ +{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/price_description/edit.html b/app/admin/view/product/price_description/edit.html new file mode 100644 index 0000000..e764766 --- /dev/null +++ b/app/admin/view/product/price_description/edit.html @@ -0,0 +1,165 @@ +{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/price_description/index.html b/app/admin/view/product/price_description/index.html new file mode 100644 index 0000000..4c48c45 --- /dev/null +++ b/app/admin/view/product/price_description/index.html @@ -0,0 +1,152 @@ +{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/specs/add.html b/app/admin/view/product/specs/add.html new file mode 100644 index 0000000..cd6974f --- /dev/null +++ b/app/admin/view/product/specs/add.html @@ -0,0 +1,167 @@ +{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/specs/edit.html b/app/admin/view/product/specs/edit.html new file mode 100644 index 0000000..e764766 --- /dev/null +++ b/app/admin/view/product/specs/edit.html @@ -0,0 +1,165 @@ +{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/specs/index.html b/app/admin/view/product/specs/index.html new file mode 100644 index 0000000..4c48c45 --- /dev/null +++ b/app/admin/view/product/specs/index.html @@ -0,0 +1,152 @@ +{extend name="common/base"/} + +{block name="body"} + +
+
+
+ +
+ +
+
+
+ + + + + + + + +{/block} + + + +{block name="script"} + +{/block} + \ No newline at end of file