diff --git a/app/admin/controller/Base.php b/app/admin/controller/Base.php index d0fac35..1a8627f 100755 --- a/app/admin/controller/Base.php +++ b/app/admin/controller/Base.php @@ -67,6 +67,8 @@ class Base extends MyController ]); } + $app_setting = getConfig('app_setting'); + View::assign("app_setting", $app_setting); } /** diff --git a/app/admin/controller/Config.php b/app/admin/controller/Config.php index 74250a5..20cf929 100755 --- a/app/admin/controller/Config.php +++ b/app/admin/controller/Config.php @@ -78,11 +78,13 @@ class Config extends Base $config = getConfig('systemconfig'); $user_config = getConfig('user_config'); $wechat_setting = getConfig('wechat_setting'); + $app_setting = getConfig('app_setting'); $wechatofficialaccount_setting = getConfig('wechatofficialaccount_setting'); View::assign("key", "systemconfig"); View::assign("data", $config); View::assign("user_config", $user_config); View::assign("wechat_setting", $wechat_setting); + View::assign("app_setting", $app_setting); View::assign("wechatofficialaccount_setting", $wechatofficialaccount_setting); return View::fetch('Config/systemconfig'); } diff --git a/app/admin/controller/Upload.php b/app/admin/controller/Upload.php index 1068108..03e492e 100755 --- a/app/admin/controller/Upload.php +++ b/app/admin/controller/Upload.php @@ -48,37 +48,33 @@ class Upload extends Base return $this->renderError("上传文件不能超过20M"); } + // 获取存储目录参数,如果没有则使用默认目录 + $dir = request()->param('dir', 'topic'); + // 判断是否上传过 $hash = $files->hash('sha1'); - $info = Db::name('picture')->where('token', $hash)->find(); - - if (false) { - $data['path'] = imageUrl($info['imgurl']); - $data['imgurl'] = $info['imgurl']; - return $this->renderSuccess('上传成功', $data); - } else { - try { - // 上传文件到腾讯云 COS - $uploadResult = $this->uploader->uploadFilePath($_FILES['file']['tmp_name'], $type); - $imgurl = $uploadResult['full_url']; - // 新增数据到数据库 - $save_data['token'] = $hash; - $save_data['imgurl'] = $imgurl; // 保存 COS 中的文件路径 - $save_data['addtime'] = time(); - $save_data['type'] = 1; - $res = Db::name('picture')->insertGetId($save_data); - if ($res) { - $data['id'] = $res; - $data['path'] = $imgurl; // 返回文件的完整访问 URL - $data['imgurl'] = $imgurl; - return $this->renderSuccess('上传成功', $data); - } else { - return $this->renderError('上传失败'); - } - } catch (\Exception $e) { - return $this->renderError('文件上传失败:' . $e->getMessage()); + try { + // 上传文件到腾讯云 COS + $uploadResult = $this->uploader->uploadFilePath($_FILES['file']['tmp_name'], $type, $dir); + $imgurl = $uploadResult['full_url']; + // 新增数据到数据库 + $save_data['token'] = $hash; + $save_data['imgurl'] = $imgurl; // 保存 COS 中的文件路径 + $save_data['addtime'] = time(); + $save_data['type'] = 1; + $res = Db::name('picture')->insertGetId($save_data); + if ($res) { + $data['id'] = $res; + $data['path'] = $imgurl; // 返回文件的完整访问 URL + $data['imgurl'] = $imgurl; + return $this->renderSuccess('上传成功', $data); + } else { + return $this->renderError('上传失败'); } + } catch (\Exception $e) { + return $this->renderError('文件上传失败:' . $e->getMessage()); } + } /** @@ -122,7 +118,7 @@ class Upload extends Base // 移动文件到目标目录 if (move_uploaded_file($_FILES['file']['tmp_name'], $savename)) { $savename = str_replace('\\', '/', $savename); - $savename = substr($savename, 1); // 去掉开头的 “.” + $savename = substr($savename, 1); // 去掉开头的 "." // 新增数据 $save_data['token'] = $hash; @@ -142,7 +138,7 @@ class Upload extends Base } } } - + /** * 阿里云oss上传 diff --git a/app/admin/controller/User.php b/app/admin/controller/User.php index cf65328..79ea3b4 100755 --- a/app/admin/controller/User.php +++ b/app/admin/controller/User.php @@ -145,7 +145,7 @@ class User extends Base } elseif ($type == 2) { $money = $user_info['integral']; } elseif ($type == 3) { - $money = $user_info['score']; + $money = $user_info['money2']; } else { $this->renderError('请求参数错误1'); } @@ -174,13 +174,13 @@ class User extends Base $money = $money * -1; } $res[] = UserModel::changeMoney($id, $money, 1, '后台变动'); - } elseif ($type == 2) {#吧唧币 + } elseif ($type == 2) {#货币2 if (RegInt($money)) { return $this->renderError('修改数量不规范,请输入大于0的整数'); } if ($type_is == 2) { if ($money > $user_info['integral']) { - return $this->renderError('账号吧唧币扣除数量不足'); + return $this->renderError('账号货币扣除数量不足'); } $money = $money * -1; } @@ -190,12 +190,12 @@ class User extends Base return $this->renderError('修改数量不规范,请输入大于0的整数'); } if ($type_is == 2) { - if ($money > $user_info['score']) { + if ($money > $user_info['money2']) { return $this->renderError('账号积分扣除数量不足'); } $money = $money * -1; } - $res[] = UserModel::changeScore($id, $money, 1, '后台变动'); + $res[] = UserModel::changeMoney2($id, $money, 1, '后台变动'); } else { $this->renderError('请求参数错误2'); } diff --git a/app/admin/view/Config/systemconfig.html b/app/admin/view/Config/systemconfig.html index b0f7cc3..cb993cf 100755 --- a/app/admin/view/Config/systemconfig.html +++ b/app/admin/view/Config/systemconfig.html @@ -4,7 +4,112 @@

系统设置

- +
+
+
项目配置
+
+
+ +
+ +
+ +
+
+
+ +
+ + +
+
+
+ +
+ +
每天允许兑换几次,0不限次数
+
+
+
+ +
+ +
+ +
+ +
+ +
+ {if !empty($app_setting.balance_icon)} + + {/if} +
+
+
+ +
+ +
+ +
+ +
+ +
+ {if !empty($app_setting.currency1_icon)} + + {/if} +
+
+
+ +
+ +
+ +
+ +
+ +
+ {if !empty($app_setting.currency2_icon)} + + {/if} +
+
+
+ +
+ +
+ +
+ {if !empty($app_setting.win_audio)} + + {/if} +
+
+
+
+ +
+
+
+
+
+
@@ -155,15 +260,88 @@
+ +
{include file="Public:footer"/} + diff --git a/app/admin/view/User/index.html b/app/admin/view/User/index.html index a3e40da..e1c2be1 100755 --- a/app/admin/view/User/index.html +++ b/app/admin/view/User/index.html @@ -106,19 +106,19 @@ - + - + - + @@ -168,8 +168,8 @@
总出货价值:{{Number(d.user_goodslist_money3).toFixed(2)}}
盒柜价值:{{(Number(d.user_hegui)).toFixed(2)}}
微信消费:{{Number(d.user_weixin_total).toFixed(2)}}
-
余额消费:{{Number(d.user_use_money).toFixed(2)}}
-
货币消费:{{Number(d.user_use_integral).toFixed(2)}}
+
{$app_setting.balance_name}消费:{{Number(d.user_use_money).toFixed(2)}}
+
{$app_setting.currency1_name}消费:{{Number(d.user_use_integral).toFixed(2)}}
回收货币:{{Number(d.user_goodslist_money).toFixed(2)}}
发货价值:{{Number(d.user_goodslist_money2).toFixed(2)}}
@@ -179,7 +179,7 @@