From f4e36f192199dfa8c860574be07c6feef10cae84 Mon Sep 17 00:00:00 2001 From: wanghao <455703030@qq.com> Date: Wed, 12 Mar 2025 12:58:14 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E6=9C=8D=E5=8A=A1=E7=AB=AF?= =?UTF-8?q?=E5=9F=BA=E7=A1=80=E6=A1=86=E6=9E=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 4 +- Backend/.env | 6 +-- Backend/.env.development | 6 +-- Server/.gitignore | 4 +- .../common/model/ProductGroupModel.php | 37 +++++++++++++++++++ .../application/common/model/ProductModel.php | 26 +++++++++++++ Server/config/database.php | 6 +-- 7 files changed, 78 insertions(+), 11 deletions(-) create mode 100644 Server/application/common/model/ProductGroupModel.php create mode 100644 Server/application/common/model/ProductModel.php diff --git a/.gitignore b/.gitignore index 723ef36f..d488eb13 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ -.idea \ No newline at end of file +.idea +Backend/dist +Backend/node_modules \ No newline at end of file diff --git a/Backend/.env b/Backend/.env index 1fd89970..41a988e0 100755 --- a/Backend/.env +++ b/Backend/.env @@ -1,6 +1,6 @@ NODE_ENV=production VUE_APP_PREVIEW=false -VUE_APP_API_BASE_URL=http://xys.morefun.vip -VUE_APP_WWW_BASE_URL=http://xys.morefun.vip -VUE_APP_WEB_SOCKET_URL=ws://xys.morefun.vip:2348 +VUE_APP_API_BASE_URL=http://yishi.com +VUE_APP_WWW_BASE_URL=http://yishi.com +VUE_APP_WEB_SOCKET_URL=ws://yishi.com:2348 VUE_APP_WEBSITE_NAME="管理后台" \ No newline at end of file diff --git a/Backend/.env.development b/Backend/.env.development index e0c5c5c0..a7a8df28 100755 --- a/Backend/.env.development +++ b/Backend/.env.development @@ -1,6 +1,6 @@ NODE_ENV=development VUE_APP_PREVIEW=true -VUE_APP_API_BASE_URL=http://xyscript.com -VUE_APP_WWW_BASE_URL=http://xyscript.com -VUE_APP_WEB_SOCKET_URL=ws://xyscript.com:2348 +VUE_APP_API_BASE_URL=http://yishi.com +VUE_APP_WWW_BASE_URL=http://yishi.com +VUE_APP_WEB_SOCKET_URL=ws://yishi.com:2348 VUE_APP_WEBSITE_NAME="管理后台" \ No newline at end of file diff --git a/Server/.gitignore b/Server/.gitignore index 18d89d30..f48aabd3 100644 --- a/Server/.gitignore +++ b/Server/.gitignore @@ -3,4 +3,6 @@ .DS_Store composer.lock runtime -public/upload \ No newline at end of file +public/upload +/public/.user.ini +/404.html diff --git a/Server/application/common/model/ProductGroupModel.php b/Server/application/common/model/ProductGroupModel.php new file mode 100644 index 00000000..165ec510 --- /dev/null +++ b/Server/application/common/model/ProductGroupModel.php @@ -0,0 +1,37 @@ +order('id', 'DESC') + ->select() as $model) { + $assoc[$model->getAttr('id')] = $model->getAttr('name'); + } + } + return $assoc; + } + + /** + * 商品数量 + * + * @return ProductModel + */ + public function productNum() { + return ProductModel::where(1) + ->where('group_id', $this->getAttr('id')) + ->count(); + } +} \ No newline at end of file diff --git a/Server/application/common/model/ProductModel.php b/Server/application/common/model/ProductModel.php new file mode 100644 index 00000000..66b7f9b3 --- /dev/null +++ b/Server/application/common/model/ProductModel.php @@ -0,0 +1,26 @@ + '未使用', + static::IS_USED_YES => '已使用', + ]; + } +} \ No newline at end of file diff --git a/Server/config/database.php b/Server/config/database.php index 3d8a6369..971ddc3c 100755 --- a/Server/config/database.php +++ b/Server/config/database.php @@ -15,11 +15,11 @@ return [ // 服务器地址 'hostname' => '127.0.0.1', // 数据库名 - 'database' => 'xianyu_script', + 'database' => 'yishi', // 用户名 - 'username' => 'xianyu_script', + 'username' => 'yishi', // 密码 - 'password' => 'Mddfts7ex3LCMRWb', + 'password' => 'KcankSjjdZ5CsTC7', // 端口 'hostport' => '', // 连接dsn