From 28c957163be873a2ad3494da6352f3632c30f6ca Mon Sep 17 00:00:00 2001 From: qinzexin <“731344816@qq.com”> Date: Fri, 27 Jun 2025 18:37:08 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=B8=BB=E7=90=86=E4=BA=BA?= =?UTF-8?q?=E5=90=8E=E5=8F=B0=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/controller/manystore/Index.php | 2 +- .../admin/controller/manystore/ShopApply.php | 7 ++ .../admin/controller/user/invoice/Header.php | 109 ++++++++++++++++++ application/admin/lang/zh-cn.php | 2 +- .../admin/view/manystore/index/add.html | 6 +- .../view/manystore/shop_apply/index.html | 3 + .../admin/view/user/invoice/header/add.html | 6 + .../admin/view/user/invoice/header/edit.html | 6 + .../common/model/dyqc/ManystoreShop.php | 18 ++- .../common/model/manystore/ShopApply.php | 2 +- .../controller/user/invoice/Header.php | 10 ++ application/manystore/lang/zh-cn.php | 2 +- .../manystore/view/dashboard/index.html | 21 ++-- .../view/user/invoice/apply/edit.html | 5 + .../view/user/invoice/header/add.html | 8 ++ .../view/user/invoice/header/edit.html | 7 ++ public/assets/js/backend/manystore/index.js | 4 +- .../assets/js/backend/manystore/shop_apply.js | 5 +- .../assets/js/backend/user/invoice/header.js | 41 +++++++ .../assets/js/manystore/user/invoice/apply.js | 41 +++++++ .../js/manystore/user/invoice/header.js | 43 +++++++ 21 files changed, 327 insertions(+), 21 deletions(-) diff --git a/application/admin/controller/manystore/Index.php b/application/admin/controller/manystore/Index.php index 5360889..57cd125 100644 --- a/application/admin/controller/manystore/Index.php +++ b/application/admin/controller/manystore/Index.php @@ -62,7 +62,7 @@ class Index extends Backend protected $error_auth = false; protected $qSwitch = true; - protected $qFields = ["user_id","name","address_detail","type","tel","legal_entity","shop_apply_id"]; + protected $qFields = ["images","image","logo","user_id","name","address_detail","type","tel","legal_entity","shop_apply_id"]; protected function checkAssemblyParameters(){ diff --git a/application/admin/controller/manystore/ShopApply.php b/application/admin/controller/manystore/ShopApply.php index 5eba6db..6e046a3 100644 --- a/application/admin/controller/manystore/ShopApply.php +++ b/application/admin/controller/manystore/ShopApply.php @@ -24,6 +24,13 @@ class ShopApply extends Backend $this->model = new \app\admin\model\manystore\ShopApply; $this->view->assign("typeList", $this->model->getTypeList()); + $this->view->assign("default_data_json", json_encode( [ +// 'name' => '默认机构名称', + 'logo' => config("site.shop_default_image"), + 'image' => config("site.shop_default_timage"), + 'images' => config("site.shop_default_images"), + ], JSON_UNESCAPED_UNICODE) ); + } diff --git a/application/admin/controller/user/invoice/Header.php b/application/admin/controller/user/invoice/Header.php index 476d962..09d0425 100644 --- a/application/admin/controller/user/invoice/Header.php +++ b/application/admin/controller/user/invoice/Header.php @@ -3,6 +3,10 @@ namespace app\admin\controller\user\invoice; use app\common\controller\Backend; +use think\Db; +use think\exception\DbException; +use think\exception\PDOException; +use think\exception\ValidateException; /** * 个人发票抬头管理 @@ -73,4 +77,109 @@ class Header extends Backend return $this->view->fetch(); } + + + + + /** + * 添加 + * + * @return string + * @throws \think\Exception + */ + public function add() + { + if (false === $this->request->isPost()) { + return $this->view->fetch(); + } + $params = $this->request->post('row/a'); + if (empty($params)) { + $this->error(__('Parameter %s can not be empty', '')); + } + $params = $this->preExcludeFields($params); + + if ($this->dataLimit && $this->dataLimitFieldAutoFill) { + $params[$this->dataLimitField] = $this->auth->id; + } + $result = false; + Db::startTrans(); + try { + //是否采用模型验证 + if ($this->modelValidate) { + $name = str_replace("\\model\\", "\\validate\\", get_class($this->model)); + $validate = is_bool($this->modelValidate) ? ($this->modelSceneValidate ? $name . '.add' : $name) : $this->modelValidate; + $this->model->validateFailException()->validate($validate); + } + + $params["is_default"] = $params["is_default"] ?? '0'; + if($params["is_default"] == '1'){ + $this->model::where('user_id',$params['user_id'])->update(['is_default'=>'0']); + } + + $result = $this->model->allowField(true)->save($params); + Db::commit(); + } catch (ValidateException|PDOException|Exception $e) { + Db::rollback(); + $this->error($e->getMessage()); + } + if ($result === false) { + $this->error(__('No rows were inserted')); + } + $this->success(); + } + + /** + * 编辑 + * + * @param $ids + * @return string + * @throws DbException + * @throws \think\Exception + */ + public function edit($ids = null) + { + $row = $this->model->get($ids); + if (!$row) { + $this->error(__('No Results were found')); + } + $adminIds = $this->getDataLimitAdminIds(); + if (is_array($adminIds) && !in_array($row[$this->dataLimitField], $adminIds)) { + $this->error(__('You have no permission')); + } + if (false === $this->request->isPost()) { + $this->view->assign('row', $row); + return $this->view->fetch(); + } + $params = $this->request->post('row/a'); + if (empty($params)) { + $this->error(__('Parameter %s can not be empty', '')); + } + $params = $this->preExcludeFields($params); + $result = false; + Db::startTrans(); + try { + //是否采用模型验证 + if ($this->modelValidate) { + $name = str_replace("\\model\\", "\\validate\\", get_class($this->model)); + $validate = is_bool($this->modelValidate) ? ($this->modelSceneValidate ? $name . '.edit' : $name) : $this->modelValidate; + $row->validateFailException()->validate($validate); + } + + $params["is_default"] = $params["is_default"] ?? '0'; + if($params["is_default"] == '1'){ + $this->model::where('user_id',$params['user_id'])->update(['is_default'=>'0']); + } + + $result = $row->allowField(true)->save($params); + Db::commit(); + } catch (ValidateException|PDOException|Exception $e) { + Db::rollback(); + $this->error($e->getMessage()); + } + if (false === $result) { + $this->error(__('No rows were updated')); + } + $this->success(); + } + } diff --git a/application/admin/lang/zh-cn.php b/application/admin/lang/zh-cn.php index f7420df..6c87471 100644 --- a/application/admin/lang/zh-cn.php +++ b/application/admin/lang/zh-cn.php @@ -203,7 +203,7 @@ return [ 'Third group' => '三级管理组', 'Second group 2' => '二级管理组2', 'Third group 2' => '三级管理组2', - 'Dashboard tips' => '用于展示当前系统中的统计数据、统计报表及重要实时数据', + 'Dashboard tips' => '', 'Config tips' => '可以在此增改系统的变量和分组,也可以自定义分组和变量', 'Category tips' => '分类类型请在常规管理->系统配置->字典配置中添加', 'Attachment tips' => '主要用于管理上传到服务器或第三方存储的数据', diff --git a/application/admin/view/manystore/index/add.html b/application/admin/view/manystore/index/add.html index 1dab7ab..c3bf5f5 100644 --- a/application/admin/view/manystore/index/add.html +++ b/application/admin/view/manystore/index/add.html @@ -102,7 +102,7 @@
- +
@@ -117,7 +117,7 @@
- +
@@ -131,7 +131,7 @@
- +
diff --git a/application/admin/view/manystore/shop_apply/index.html b/application/admin/view/manystore/shop_apply/index.html index 6c22245..2663347 100644 --- a/application/admin/view/manystore/shop_apply/index.html +++ b/application/admin/view/manystore/shop_apply/index.html @@ -27,3 +27,6 @@
+ diff --git a/application/admin/view/user/invoice/header/add.html b/application/admin/view/user/invoice/header/add.html index 1f734af..5ecf18d 100644 --- a/application/admin/view/user/invoice/header/add.html +++ b/application/admin/view/user/invoice/header/add.html @@ -42,6 +42,8 @@
+ +
@@ -72,6 +74,10 @@
+ + +
+
diff --git a/application/admin/view/user/invoice/header/edit.html b/application/admin/view/user/invoice/header/edit.html index 463a7dc..75e6251 100644 --- a/application/admin/view/user/invoice/header/edit.html +++ b/application/admin/view/user/invoice/header/edit.html @@ -45,6 +45,9 @@
+ + +
@@ -75,6 +78,9 @@
+ +
+
diff --git a/application/common/model/dyqc/ManystoreShop.php b/application/common/model/dyqc/ManystoreShop.php index 6a47247..910c658 100644 --- a/application/common/model/dyqc/ManystoreShop.php +++ b/application/common/model/dyqc/ManystoreShop.php @@ -219,10 +219,22 @@ class ManystoreShop extends BaseModel if($id && $this->checkFull($id)){ //必要信息已完善 return '
- 必要展示信息已完善!可正常上架课程!
'; + + + 必要展示信息已完善!可正常上架活动!
'; }else{ //必要信息未完善 - return "
必要展示信息未完善,请先在机构完善展示信息

+ return "
+ + + +必要展示信息未完善,请先在机构完善展示信息

必要展示信息为:


1:地址信息:包括详细地址、所在城市、所在省、所在市、所在县、经纬度
@@ -232,7 +244,7 @@ class ManystoreShop extends BaseModel 5:环境图片
6:服务电话
7:详情


- 请您确保上述信息均已完善后才能正常上架课程。

+ 请您确保上述信息均已完善后才能正常上架活动。

若已完善请您刷新页面。

"; diff --git a/application/common/model/manystore/ShopApply.php b/application/common/model/manystore/ShopApply.php index 9cbd4b8..c0adcbc 100644 --- a/application/common/model/manystore/ShopApply.php +++ b/application/common/model/manystore/ShopApply.php @@ -21,7 +21,7 @@ class ShopApply extends BaseModel protected $name = 'manystore_shop_apply'; // 自动写入时间戳字段 - protected $autoWriteTimestamp = false; + protected $autoWriteTimestamp = true; // 定义时间戳字段名 protected $createTime = "create_time"; diff --git a/application/manystore/controller/user/invoice/Header.php b/application/manystore/controller/user/invoice/Header.php index 2c03afb..c95a263 100644 --- a/application/manystore/controller/user/invoice/Header.php +++ b/application/manystore/controller/user/invoice/Header.php @@ -107,6 +107,11 @@ class Header extends ManystoreBase $validate = is_bool($this->modelValidate) ? ($this->modelSceneValidate ? $name . '.add' : $name) : $this->modelValidate; $this->model->validateFailException(true)->validate($validate); } + $params["is_default"] = $params["is_default"] ?? '0'; + if($params["is_default"] == '1'){ + $this->model::where('user_id',$params['user_id'])->update(['is_default'=>'0']); + } + $result = $this->model->allowField(true)->save($params); Db::commit(); } catch (ValidateException $e) { @@ -160,6 +165,11 @@ class Header extends ManystoreBase } $params['user_id'] = SHOP_USER_ID; + $params["is_default"] = $params["is_default"] ?? '0'; + if($params["is_default"] == '1'){ + $this->model::where('user_id',$params['user_id'])->update(['is_default'=>'0']); + } + $result = $row->allowField(true)->save($params); Db::commit(); } catch (ValidateException $e) { diff --git a/application/manystore/lang/zh-cn.php b/application/manystore/lang/zh-cn.php index 650ac35..105b5f4 100644 --- a/application/manystore/lang/zh-cn.php +++ b/application/manystore/lang/zh-cn.php @@ -171,7 +171,7 @@ return [ 'Third group' => '三级管理组', 'Second group 2' => '二级管理组2', 'Third group 2' => '三级管理组2', - 'Dashboard tips' => '用于展示当前系统中的统计数据、统计报表及重要实时数据', + 'Dashboard tips' => '', 'Config tips' => '提示:修改相关配置后,点击【确认】才会保存生效', 'Category tips' => '用于统一管理网站的所有分类,分类可进行无限级分类,分类类型请在常规管理->系统配置->字典配置中添加', 'Attachment tips' => '主要用于管理上传到服务器或第三方存储的数据', diff --git a/application/manystore/view/dashboard/index.html b/application/manystore/view/dashboard/index.html index 0e85d79..c4873b5 100644 --- a/application/manystore/view/dashboard/index.html +++ b/application/manystore/view/dashboard/index.html @@ -155,7 +155,7 @@ {:build_heading(null, false)}
@@ -164,6 +164,11 @@
+ + 温馨提示:

尊敬的用户您好,欢迎登录我们的后台管理系统!在您开始使用各项功能之前,我们特此提醒您注意以下几点重要事项:

@@ -384,13 +389,13 @@
-
-
-
- {:__('Custom zone')} -
-
-
+ + + + + + +
diff --git a/application/manystore/view/user/invoice/apply/edit.html b/application/manystore/view/user/invoice/apply/edit.html index a529909..bab2ebd 100644 --- a/application/manystore/view/user/invoice/apply/edit.html +++ b/application/manystore/view/user/invoice/apply/edit.html @@ -77,6 +77,9 @@
+ + +
@@ -107,6 +110,8 @@
+ +
diff --git a/application/manystore/view/user/invoice/header/add.html b/application/manystore/view/user/invoice/header/add.html index 6c1a472..249e4b1 100644 --- a/application/manystore/view/user/invoice/header/add.html +++ b/application/manystore/view/user/invoice/header/add.html @@ -36,6 +36,10 @@
+ + + +
@@ -66,6 +70,10 @@
+ + +
+
diff --git a/application/manystore/view/user/invoice/header/edit.html b/application/manystore/view/user/invoice/header/edit.html index ec0b09d..a4b8df6 100644 --- a/application/manystore/view/user/invoice/header/edit.html +++ b/application/manystore/view/user/invoice/header/edit.html @@ -36,6 +36,10 @@
+ + + +
@@ -66,6 +70,9 @@
+ + +
diff --git a/public/assets/js/backend/manystore/index.js b/public/assets/js/backend/manystore/index.js index 5569bb7..1f01da3 100644 --- a/public/assets/js/backend/manystore/index.js +++ b/public/assets/js/backend/manystore/index.js @@ -25,7 +25,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin url: $.fn.bootstrapTable.defaults.extend.index_url, pk: 'id', fixedColumns: true, - fixedRightNumber: 2, + fixedRightNumber: 1, columns: [ [ {checkbox: true}, @@ -84,7 +84,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin {field: 'logintime', title: __('Login time'), formatter: Table.api.formatter.datetime, operate: 'RANGE', addclass: 'datetimerange', sortable: true}, - {field: 'miniqrcode_link', title: __('微信小程序端展示'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image}, + // {field: 'miniqrcode_link', title: __('微信小程序端展示'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image}, {field: 'operate', title: __('Operate'),width:180, table: table , buttons: [ {name: 'url', text: '查看小程序链接', diff --git a/public/assets/js/backend/manystore/shop_apply.js b/public/assets/js/backend/manystore/shop_apply.js index 63427ec..0468b19 100644 --- a/public/assets/js/backend/manystore/shop_apply.js +++ b/public/assets/js/backend/manystore/shop_apply.js @@ -112,7 +112,10 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin return 'manystore/index/add?user_id='+row.user_id + '&type='+row.type - + '&name=' + (row.name || row.realname) + + '&logo='+encodeURIComponent( row.user.avatar ? row.user.avatar : default_data_json.logo) + + '&image='+ encodeURIComponent(default_data_json.image) + + '&images='+ encodeURIComponent(default_data_json.images) + + '&name=' + encodeURIComponent(row.name || row.realname) + '&tel='+row.mobile + '&shop_apply_id='+row.id + '&address_detail='+row.address + '&legal_entity='+row.realname; diff --git a/public/assets/js/backend/user/invoice/header.js b/public/assets/js/backend/user/invoice/header.js index 9867a10..b83e5ed 100644 --- a/public/assets/js/backend/user/invoice/header.js +++ b/public/assets/js/backend/user/invoice/header.js @@ -61,9 +61,50 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin }, api: { bindevent: function () { + shop_apply.listen(); Form.api.bindevent($("form[role=form]")); } } }; + + + + var shop_apply = { + listen:function () { + + this.setOfflineType($("select[name='row[head_type]']").val()); + this.offlineListen(); + }, + offlineListen:function () { + var that = this; + // console.log($("input:radio[name='row[address_type]']").val()) + // this.setOfflineType($("input:radio[name='row[address_type]']").val()); + // $("input:radio[name='row[head_type]']").change(function (){ + // + // console.log(1111111); + // that.setOfflineType($(this).val()); + // }); + //改成下拉 + $("select[name='row[head_type]']").change(function (){ + that.setOfflineType($(this).val()); + }); + + }, + setOfflineType:function (val) { + switch (val) { + case 'personal': //个人 + $('#enterprise_data').hide(); + + break; + case 'corporate': //企业 + $('#enterprise_data').show(); + + break; + } + }, + + } + + return Controller; }); diff --git a/public/assets/js/manystore/user/invoice/apply.js b/public/assets/js/manystore/user/invoice/apply.js index 642607a..2d087ea 100644 --- a/public/assets/js/manystore/user/invoice/apply.js +++ b/public/assets/js/manystore/user/invoice/apply.js @@ -77,9 +77,50 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin }, api: { bindevent: function () { + shop_apply.listen(); Form.api.bindevent($("form[role=form]")); } } }; + + + + var shop_apply = { + listen:function () { + + this.setOfflineType($("select[name='row[head_type]']").val()); + this.offlineListen(); + }, + offlineListen:function () { + var that = this; + // console.log($("input:radio[name='row[address_type]']").val()) + // this.setOfflineType($("input:radio[name='row[address_type]']").val()); + // $("input:radio[name='row[head_type]']").change(function (){ + // + // console.log(1111111); + // that.setOfflineType($(this).val()); + // }); + //改成下拉 + $("select[name='row[head_type]']").change(function (){ + that.setOfflineType($(this).val()); + }); + + }, + setOfflineType:function (val) { + switch (val) { + case 'personal': //个人 + $('#enterprise_data').hide(); + + break; + case 'corporate': //企业 + $('#enterprise_data').show(); + + break; + } + }, + + } + + return Controller; }); \ No newline at end of file diff --git a/public/assets/js/manystore/user/invoice/header.js b/public/assets/js/manystore/user/invoice/header.js index 5b165c1..89e09d4 100644 --- a/public/assets/js/manystore/user/invoice/header.js +++ b/public/assets/js/manystore/user/invoice/header.js @@ -59,9 +59,52 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin }, api: { bindevent: function () { + shop_apply.listen(); Form.api.bindevent($("form[role=form]")); } } }; + + + + + var shop_apply = { + listen:function () { + + this.setOfflineType($("select[name='row[head_type]']").val()); + this.offlineListen(); + }, + offlineListen:function () { + var that = this; + // console.log($("input:radio[name='row[address_type]']").val()) + // this.setOfflineType($("input:radio[name='row[address_type]']").val()); + // $("input:radio[name='row[head_type]']").change(function (){ + // + // console.log(1111111); + // that.setOfflineType($(this).val()); + // }); + //改成下拉 + $("select[name='row[head_type]']").change(function (){ + that.setOfflineType($(this).val()); + }); + + }, + setOfflineType:function (val) { + switch (val) { + case 'personal': //个人 + $('#enterprise_data').hide(); + + break; + case 'corporate': //企业 + $('#enterprise_data').show(); + + break; + } + }, + + } + + + return Controller; }); \ No newline at end of file