From a33039406abaf6781e25bcc213c38b95ff064b34 Mon Sep 17 00:00:00 2001
From: lisong <377344020@qq.com>
Date: Tue, 30 Nov 2021 16:40:01 +0800
Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
application/admin/common.php | 88 +
.../admin/controller/AccountLogController.php | 53 +
.../controller/ArticleCategoryController.php | 103 -
.../admin/controller/ArticleController.php | 141 -
.../admin/controller/BrandController.php | 123 -
.../controller/DeliverAddressController.php | 123 -
.../admin/controller/DemoController.php | 175 -
.../admin/controller/EditorController.php | 24 -
.../admin/controller/ExpressController.php | 105 -
.../admin/controller/FinanceController.php | 24 +
.../GoodsAttrCategoryController.php | 170 -
.../admin/controller/GoodsController.php | 79 +-
.../admin/controller/IndexController.php | 104 +-
.../admin/controller/OrderController.php | 150 +-
.../admin/controller/ShopConfigController.php | 125 +
.../admin/controller/TagController.php | 105 -
.../admin/controller/TestController.php | 131 -
.../admin/controller/UserController.php | 112 +-
.../admin/controller/UserLevelController.php | 152 -
.../admin/controller/WeChatController.php | 159 -
.../admin/controller/WithdrawController.php | 149 +
.../admin/view/account_log/integrallist.html | 174 +
application/admin/view/article/add.html | 243 -
application/admin/view/article/index.html | 138 -
.../admin/view/article_category/add.html | 100 -
.../admin/view/article_category/index.html | 83 -
application/admin/view/brand/add.html | 95 -
application/admin/view/brand/index.html | 131 -
.../admin/view/deliver_address/add.html | 282 -
.../admin/view/deliver_address/index.html | 138 -
application/admin/view/demo/email.html | 92 -
application/admin/view/demo/qr_code.html | 164 -
application/admin/view/demo/sms.html | 70 -
application/admin/view/express/add.html | 91 -
application/admin/view/express/index.html | 124 -
application/admin/view/finance/lists.html | 177 +
application/admin/view/goods/add.html | 24 +-
application/admin/view/goods/index.html | 12 +-
.../admin/view/goods_attr_category/add.html | 170 -
.../admin/view/goods_attr_category/index.html | 118 -
application/admin/view/index/index.html | 351 +-
application/admin/view/layout1.html | 29 +
application/admin/view/order/add.html | 349 -
application/admin/view/order/detail.html | 113 -
application/admin/view/order/index.html | 219 +-
application/admin/view/public/head_js.html | 2 +
.../admin/view/shop_config/fenxiao.html | 81 +
application/admin/view/shop_config/goods.html | 114 +
.../admin/view/shop_config/policy.html | 69 +
.../admin/view/shop_config/shouyi.html | 102 +
.../admin/view/shop_config/withdraw.html | 59 +
application/admin/view/slide/add.html | 94 +-
application/admin/view/statistics/index.html | 145 -
application/admin/view/tag/add.html | 76 -
application/admin/view/tag/index.html | 122 -
application/admin/view/test/add.html | 76 -
application/admin/view/test/index.html | 139 -
application/admin/view/user/add.html | 148 +-
application/admin/view/user/equipmentadd.html | 141 +
application/admin/view/user/index.html | 255 +-
application/admin/view/user_level/add.html | 138 -
application/admin/view/user_level/index.html | 165 -
application/admin/view/we_chat/index.html | 115 -
application/admin/view/withdraw/lists.html | 252 +
application/admin/view/withdraw/review.html | 118 +
application/common.php | 53 +
application/common/model/AccountLog.php | 66 +
application/common/model/Article.php | 33 -
application/common/model/ArticleCategory.php | 26 -
application/common/model/ArticleTag.php | 14 -
application/common/model/Brand.php | 27 -
application/common/model/DeliverAddress.php | 57 -
application/common/model/Express.php | 27 -
application/common/model/Goods.php | 7 -
application/common/model/GoodsAttr.php | 25 -
.../common/model/GoodsAttrCategory.php | 25 -
.../common/model/{Test.php => MallImage.php} | 15 +-
application/common/model/Model.php | 4 +
application/common/model/Order.php | 124 +-
application/common/model/OrderGoods.php | 26 -
application/common/model/ShopConfig.php | 60 +
application/common/model/Slide.php | 4 -
application/common/model/Tag.php | 26 -
application/common/model/User.php | 15 +
application/common/model/WithdrawApply.php | 70 +
.../common/validate/AccountLogValidate.php | 46 +
application/common/validate/OrderValidate.php | 57 +-
.../common/validate/ShopConfigValidate.php | 32 +
.../common/validate/WithdrawApplyValidate.php | 70 +
.../index/controller/IndexController.php | 3 +-
config/admin/admin.php | 2 +-
config/app.php | 2 +-
public/.user.ini | 0
.../07871258bf9fd02febf83570d9bb18f5.png | Bin
...871258bf9fd02febf83570d9bb18f5_750_461.png | Bin
.../27df77fadbe8fedd149e09bd83a43a19.jpg | Bin 0 -> 121612 bytes
...df77fadbe8fedd149e09bd83a43a19_750_461.jpg | Bin 0 -> 18337 bytes
.../4a0604cbfc29e2104a8ea02838f74f99.png | Bin
...0604cbfc29e2104a8ea02838f74f99_750_461.png | Bin
.../6092c886bcd1653e765eb6d0fc13d19b.png | Bin 0 -> 103828 bytes
...92c886bcd1653e765eb6d0fc13d19b_750_461.png | Bin 0 -> 86774 bytes
.../6ce1866130d2800bf67603ca71412ace.png | Bin
.../b426b10c428d4ac24b2dcbea7f1f7a91.png | Bin 0 -> 103828 bytes
...26b10c428d4ac24b2dcbea7f1f7a91_750_461.png | Bin 0 -> 86774 bytes
.../ba8f5f202178fc76f8cd792b90ea717f.png | Bin
...8f5f202178fc76f8cd792b90ea717f_750_461.png | Bin
.../e7762b187771afb2271c6088620718d5.png | Bin
...762b187771afb2271c6088620718d5_750_461.png | Bin
.../ede938d62a2e396f31abb57ea2af9700.png | Bin
...e938d62a2e396f31abb57ea2af9700_750_461.png | Bin
.../0d22b931bff501c2e11c19a13017e55b.jpg | Bin 0 -> 121612 bytes
.../5e508286a5a4e801d738d7199dadd660.jpg | Bin 0 -> 121612 bytes
.../e0fd3ca54619bd110412aadd30c5d0bf.jpg | Bin 0 -> 121612 bytes
...fd3ca54619bd110412aadd30c5d0bf_200_200.jpg | Bin 0 -> 6300 bytes
.../bd8f243a28c1bdde73ff567a81b5d6bb.png | Bin 0 -> 103828 bytes
.../6f/39a5aa69af641b0541a753540c4034.php | 2 +-
runtime/log/202111/24.log | 18657 ++++++++++++++++
runtime/log/202111/25.log | 11657 ++++++++++
runtime/log/202111/27.log | 108 +
runtime/log/202111/28.log | 1366 ++
runtime/log/202111/29.log | 3934 ++++
runtime/log/202111/30.log | 12352 ++++++++++
.../temp/0198aab747e4a4b973ffd3ca987b1858.php | 0
.../temp/02ff5eadbd620754d94263921e887193.php | 407 +
.../temp/0ad4c9808a7113e1b78f074b9f86daa2.php | 0
.../temp/0bf595331e4fda5be5cabb4da5faedfb.php | 392 +
.../temp/0e41a8aff3f00409f646a0babdb3e375.php | 1055 +
.../temp/12bb592cf830a86fd63619b5f588cc0d.php | 296 +
.../temp/15d8463f0b45fb827affe886885ff48b.php | 274 +
.../temp/1643a94ac5152af6d518f0b339b39b7e.php | 326 +
.../temp/1f528efffecd7782ef7302d919f9d9fb.php | 0
.../temp/2610a0a47385ec3697c6c48d251ba74c.php | 457 +
.../temp/261492977be39a65689579e0c471c045.php | 304 +
.../temp/2aa4b29a927bac30bb9b1684a442cdd1.php | 486 +
.../temp/2bd954b07bf2bd33a16be742a41da912.php | 0
.../temp/2dec0c6b90400e4e601a4917fe0cb673.php | 386 +
.../temp/3179745d35894ebcffbf82820017c581.php | 412 +
.../temp/3da73821bf8efbc88abdf784f5ecb205.php | 261 +
.../temp/47f75dc606ee0ba6f5a7b40d23b773cd.php | 472 +
.../temp/490cc98cd65aea69f95671561d2a5676.php | 347 +
.../temp/5b63cfa829268cac30c524bed87823cb.php | 400 +
.../temp/5ecce8cad813aaee5e5f1b2a4508433b.php | 359 +
.../temp/614e97609d261934425b1baf2d26d9b9.php | 314 +
.../temp/61b48d0671dcc6c3934bc43d39eef235.php | 399 +
.../temp/6a6fb1a2ecbacae95ad8048c8914b758.php | 0
.../temp/6edeac7c16d288d99914b8df677e1f4d.php | 381 +
.../temp/8ce96d2ccf9fdb84dec78e0d6b3894eb.php | 397 +
.../temp/8e00cde16466ac17d1f48848ea9edd93.php | 381 +
.../temp/923f6b76fd7936e9ee797826e53591ee.php | 0
.../temp/92ce4fe6e0ffd7b98486d7b6cd264737.php | 40 +
.../temp/96f9d553a18f3231f074f626de1815a2.php | 458 +
.../temp/9727c31891dd25a4108fae0db45c4d86.php | 329 +
.../temp/a045e9977e4fe456fabf09b878a174d2.php | 236 +
.../temp/a83f3931cb0a5ea199029f5bec1163b3.php | 515 +
.../temp/b77ef641e1a16f32561a8512f4601252.php | 637 +
.../temp/baab3be00eccd6fb51c44d19b9f4d0b8.php | 0
.../temp/c61f2898fb8e57afe2b7149fc21ea93b.php | 209 +
.../temp/c656dd49758c8dbfe53de2ca99d2ba71.php | 422 +
.../temp/cd3367801629ec6765eafe20c5c36ebb.php | 413 +
.../temp/d112b38d2916e192569347d402ab8ffd.php | 0
.../temp/d37914ba03bc26e81f6068b1b7351c81.php | 418 +
.../temp/db717213f788d904396d7e40b8819b5c.php | 369 +
.../temp/e02ecfe643e6d8db4003d82dfc47a91b.php | 0
.../temp/ea2b43c0efd4291c5463fce50a50f898.php | 0
.../temp/f921e9c60f73462d4e20174722ee091c.php | 496 +
165 files changed, 64232 insertions(+), 6101 deletions(-)
create mode 100644 application/admin/controller/AccountLogController.php
delete mode 100755 application/admin/controller/ArticleCategoryController.php
delete mode 100755 application/admin/controller/ArticleController.php
delete mode 100755 application/admin/controller/BrandController.php
delete mode 100755 application/admin/controller/DeliverAddressController.php
delete mode 100755 application/admin/controller/DemoController.php
delete mode 100755 application/admin/controller/EditorController.php
delete mode 100755 application/admin/controller/ExpressController.php
create mode 100755 application/admin/controller/FinanceController.php
delete mode 100755 application/admin/controller/GoodsAttrCategoryController.php
create mode 100644 application/admin/controller/ShopConfigController.php
delete mode 100755 application/admin/controller/TagController.php
delete mode 100755 application/admin/controller/TestController.php
delete mode 100755 application/admin/controller/UserLevelController.php
delete mode 100755 application/admin/controller/WeChatController.php
create mode 100644 application/admin/controller/WithdrawController.php
create mode 100644 application/admin/view/account_log/integrallist.html
delete mode 100755 application/admin/view/article/add.html
delete mode 100755 application/admin/view/article/index.html
delete mode 100755 application/admin/view/article_category/add.html
delete mode 100755 application/admin/view/article_category/index.html
delete mode 100755 application/admin/view/brand/add.html
delete mode 100755 application/admin/view/brand/index.html
delete mode 100755 application/admin/view/deliver_address/add.html
delete mode 100755 application/admin/view/deliver_address/index.html
delete mode 100755 application/admin/view/demo/email.html
delete mode 100755 application/admin/view/demo/qr_code.html
delete mode 100755 application/admin/view/demo/sms.html
delete mode 100755 application/admin/view/express/add.html
delete mode 100755 application/admin/view/express/index.html
create mode 100755 application/admin/view/finance/lists.html
delete mode 100755 application/admin/view/goods_attr_category/add.html
delete mode 100755 application/admin/view/goods_attr_category/index.html
create mode 100755 application/admin/view/layout1.html
delete mode 100755 application/admin/view/order/add.html
delete mode 100755 application/admin/view/order/detail.html
create mode 100644 application/admin/view/shop_config/fenxiao.html
create mode 100644 application/admin/view/shop_config/goods.html
create mode 100644 application/admin/view/shop_config/policy.html
create mode 100644 application/admin/view/shop_config/shouyi.html
create mode 100644 application/admin/view/shop_config/withdraw.html
delete mode 100755 application/admin/view/statistics/index.html
delete mode 100755 application/admin/view/tag/add.html
delete mode 100755 application/admin/view/tag/index.html
delete mode 100755 application/admin/view/test/add.html
delete mode 100755 application/admin/view/test/index.html
create mode 100755 application/admin/view/user/equipmentadd.html
delete mode 100755 application/admin/view/user_level/add.html
delete mode 100755 application/admin/view/user_level/index.html
delete mode 100755 application/admin/view/we_chat/index.html
create mode 100644 application/admin/view/withdraw/lists.html
create mode 100644 application/admin/view/withdraw/review.html
create mode 100644 application/common/model/AccountLog.php
delete mode 100755 application/common/model/Article.php
delete mode 100755 application/common/model/ArticleCategory.php
delete mode 100755 application/common/model/ArticleTag.php
delete mode 100755 application/common/model/Brand.php
delete mode 100755 application/common/model/DeliverAddress.php
delete mode 100755 application/common/model/Express.php
delete mode 100755 application/common/model/GoodsAttr.php
delete mode 100755 application/common/model/GoodsAttrCategory.php
rename application/common/model/{Test.php => MallImage.php} (50%)
delete mode 100755 application/common/model/OrderGoods.php
create mode 100644 application/common/model/ShopConfig.php
delete mode 100755 application/common/model/Tag.php
create mode 100644 application/common/model/WithdrawApply.php
create mode 100644 application/common/validate/AccountLogValidate.php
create mode 100644 application/common/validate/ShopConfigValidate.php
create mode 100644 application/common/validate/WithdrawApplyValidate.php
mode change 100644 => 100755 public/.user.ini
mode change 100644 => 100755 public/uploads/attachment/20211124/07871258bf9fd02febf83570d9bb18f5.png
mode change 100644 => 100755 public/uploads/attachment/20211124/07871258bf9fd02febf83570d9bb18f5_750_461.png
create mode 100644 public/uploads/attachment/20211124/27df77fadbe8fedd149e09bd83a43a19.jpg
create mode 100644 public/uploads/attachment/20211124/27df77fadbe8fedd149e09bd83a43a19_750_461.jpg
mode change 100644 => 100755 public/uploads/attachment/20211124/4a0604cbfc29e2104a8ea02838f74f99.png
mode change 100644 => 100755 public/uploads/attachment/20211124/4a0604cbfc29e2104a8ea02838f74f99_750_461.png
create mode 100644 public/uploads/attachment/20211124/6092c886bcd1653e765eb6d0fc13d19b.png
create mode 100644 public/uploads/attachment/20211124/6092c886bcd1653e765eb6d0fc13d19b_750_461.png
mode change 100644 => 100755 public/uploads/attachment/20211124/6ce1866130d2800bf67603ca71412ace.png
create mode 100644 public/uploads/attachment/20211124/b426b10c428d4ac24b2dcbea7f1f7a91.png
create mode 100644 public/uploads/attachment/20211124/b426b10c428d4ac24b2dcbea7f1f7a91_750_461.png
mode change 100644 => 100755 public/uploads/attachment/20211124/ba8f5f202178fc76f8cd792b90ea717f.png
mode change 100644 => 100755 public/uploads/attachment/20211124/ba8f5f202178fc76f8cd792b90ea717f_750_461.png
mode change 100644 => 100755 public/uploads/attachment/20211124/e7762b187771afb2271c6088620718d5.png
mode change 100644 => 100755 public/uploads/attachment/20211124/e7762b187771afb2271c6088620718d5_750_461.png
mode change 100644 => 100755 public/uploads/attachment/20211124/ede938d62a2e396f31abb57ea2af9700.png
mode change 100644 => 100755 public/uploads/attachment/20211124/ede938d62a2e396f31abb57ea2af9700_750_461.png
create mode 100644 public/uploads/attachment/20211130/0d22b931bff501c2e11c19a13017e55b.jpg
create mode 100644 public/uploads/attachment/20211130/5e508286a5a4e801d738d7199dadd660.jpg
create mode 100644 public/uploads/attachment/20211130/e0fd3ca54619bd110412aadd30c5d0bf.jpg
create mode 100644 public/uploads/attachment/20211130/e0fd3ca54619bd110412aadd30c5d0bf_200_200.jpg
create mode 100644 public/uploads/ueditor/20211124/bd8f243a28c1bdde73ff567a81b5d6bb.png
mode change 100644 => 100755 runtime/log/202111/24.log
create mode 100644 runtime/log/202111/25.log
create mode 100644 runtime/log/202111/27.log
create mode 100644 runtime/log/202111/28.log
create mode 100644 runtime/log/202111/29.log
create mode 100644 runtime/log/202111/30.log
mode change 100644 => 100755 runtime/temp/0198aab747e4a4b973ffd3ca987b1858.php
create mode 100644 runtime/temp/02ff5eadbd620754d94263921e887193.php
mode change 100644 => 100755 runtime/temp/0ad4c9808a7113e1b78f074b9f86daa2.php
create mode 100644 runtime/temp/0bf595331e4fda5be5cabb4da5faedfb.php
create mode 100644 runtime/temp/0e41a8aff3f00409f646a0babdb3e375.php
create mode 100644 runtime/temp/12bb592cf830a86fd63619b5f588cc0d.php
create mode 100644 runtime/temp/15d8463f0b45fb827affe886885ff48b.php
create mode 100644 runtime/temp/1643a94ac5152af6d518f0b339b39b7e.php
mode change 100644 => 100755 runtime/temp/1f528efffecd7782ef7302d919f9d9fb.php
create mode 100644 runtime/temp/2610a0a47385ec3697c6c48d251ba74c.php
create mode 100644 runtime/temp/261492977be39a65689579e0c471c045.php
create mode 100644 runtime/temp/2aa4b29a927bac30bb9b1684a442cdd1.php
mode change 100644 => 100755 runtime/temp/2bd954b07bf2bd33a16be742a41da912.php
create mode 100644 runtime/temp/2dec0c6b90400e4e601a4917fe0cb673.php
create mode 100644 runtime/temp/3179745d35894ebcffbf82820017c581.php
create mode 100644 runtime/temp/3da73821bf8efbc88abdf784f5ecb205.php
create mode 100644 runtime/temp/47f75dc606ee0ba6f5a7b40d23b773cd.php
create mode 100644 runtime/temp/490cc98cd65aea69f95671561d2a5676.php
create mode 100644 runtime/temp/5b63cfa829268cac30c524bed87823cb.php
create mode 100644 runtime/temp/5ecce8cad813aaee5e5f1b2a4508433b.php
create mode 100644 runtime/temp/614e97609d261934425b1baf2d26d9b9.php
create mode 100644 runtime/temp/61b48d0671dcc6c3934bc43d39eef235.php
mode change 100644 => 100755 runtime/temp/6a6fb1a2ecbacae95ad8048c8914b758.php
create mode 100644 runtime/temp/6edeac7c16d288d99914b8df677e1f4d.php
create mode 100644 runtime/temp/8ce96d2ccf9fdb84dec78e0d6b3894eb.php
create mode 100644 runtime/temp/8e00cde16466ac17d1f48848ea9edd93.php
mode change 100644 => 100755 runtime/temp/923f6b76fd7936e9ee797826e53591ee.php
create mode 100644 runtime/temp/92ce4fe6e0ffd7b98486d7b6cd264737.php
create mode 100644 runtime/temp/96f9d553a18f3231f074f626de1815a2.php
create mode 100644 runtime/temp/9727c31891dd25a4108fae0db45c4d86.php
create mode 100644 runtime/temp/a045e9977e4fe456fabf09b878a174d2.php
create mode 100644 runtime/temp/a83f3931cb0a5ea199029f5bec1163b3.php
create mode 100644 runtime/temp/b77ef641e1a16f32561a8512f4601252.php
mode change 100644 => 100755 runtime/temp/baab3be00eccd6fb51c44d19b9f4d0b8.php
create mode 100644 runtime/temp/c61f2898fb8e57afe2b7149fc21ea93b.php
create mode 100644 runtime/temp/c656dd49758c8dbfe53de2ca99d2ba71.php
create mode 100644 runtime/temp/cd3367801629ec6765eafe20c5c36ebb.php
mode change 100644 => 100755 runtime/temp/d112b38d2916e192569347d402ab8ffd.php
create mode 100644 runtime/temp/d37914ba03bc26e81f6068b1b7351c81.php
create mode 100644 runtime/temp/db717213f788d904396d7e40b8819b5c.php
mode change 100644 => 100755 runtime/temp/e02ecfe643e6d8db4003d82dfc47a91b.php
mode change 100644 => 100755 runtime/temp/ea2b43c0efd4291c5463fce50a50f898.php
create mode 100644 runtime/temp/f921e9c60f73462d4e20174722ee091c.php
diff --git a/application/admin/common.php b/application/admin/common.php
index a8324df..b69d855 100755
--- a/application/admin/common.php
+++ b/application/admin/common.php
@@ -6,6 +6,8 @@ const URL_BACK = 'url://back';
use think\exception\HttpResponseException;
use think\Response;
use think\response\Redirect;
+use app\common\model\MallImage;
+use think\db;
if (!function_exists('success')) {
@@ -50,4 +52,90 @@ if (!function_exists('result')) {
throw new HttpResponseException($response);
}
+}
+
+if(!function_exists('goods_imgs_upload')){
+ /**
+ * 简单对称加密算法之解密
+ * @param String $union_id 指定id
+ * @param String $type 类型
+ * @param String $ori_img 原图
+ * @param String $thumb_img 缩略图
+ * @param String $ori_fm_img 原图封面
+ * @param String $thumb_img_f 缩略图封面
+ * @param String $goods_imgs 编辑时数据库中图片
+ * @date 20190906
+ * @return li
+ */
+ //上传商品图片
+ function goods_imgs_upload($union_id,$type,$ori_img, $thumb_img,$ori_fm_img,$thumb_img_f,$goods_imgs=array())
+ {
+ $_goodsimgsModel= new MallImage();
+ //$tps = C('TMPL_PARSE_STRING');
+ $inequality_img=array();
+ if($ori_img){
+ $ori_img_ys=array();
+ if($goods_imgs){
+ foreach ($goods_imgs as $key=> $v){
+ $ori_img_ys[$v['id']]=$v['ori_image'];
+ $goods_imgs[$v['id']]=$v;
+ }
+ $inequality_img = array_diff($ori_img_ys,$ori_img);//前端踢掉的图片
+ }
+ foreach ($ori_img as $key=> $v){
+ if(in_array($v,$ori_img_ys,TRUE)){
+ if($v==$ori_fm_img && $thumb_img_f=$thumb_img[$key]){
+ $data3['is_cover']=1;
+ }else{
+ $data3['is_cover']=0;
+ }
+ $_goodsimgsModel->where(array('ori_image'=>$v))->update($data3);
+ continue;
+ }
+ $ori_img_url=trim($v);
+ if(!$ori_img_url){
+ $array = array(
+ 'code' =>400,
+ 'msg' =>'上传文件处理失败',
+ );
+ return $array;
+ }
+ $thumb_img_url=trim($thumb_img[$key]);
+ if(!$thumb_img_url){
+ $array = array(
+ 'code' =>400,
+ 'msg' =>'上传文件处理失败',
+ );
+ return $array;
+ }
+ $data1['ori_image']=$yu_url=$ori_img_url;
+ $data1['thumb_image']=$slt_url=$thumb_img_url;
+ if($v==$ori_fm_img && $thumb_img_f=$thumb_img[$key]){
+ $data1['is_cover']=1;
+ }else{
+ $data1['is_cover']=0;
+ }
+ $data1['type']=$type;
+ $data1['union_id']=$union_id;
+ $_goodsimgsModel::create($data1);
+ }
+ if($inequality_img){
+ foreach ($inequality_img as $key1=> $v1){
+ $mag=Db::table('yo_mall_image')->where('id',$key1)->delete();
+ if($mag){
+ $ori_image_del=Env::get('root_path').'public'.$goods_imgs[$key1]['ori_image'];
+ if(file_exists($ori_image_del))
+ {
+ unlink($ori_image_del);
+ }
+ $thumb_image_del=Env::get('root_path').'public'.$goods_imgs[$key1]['thumb_image'];
+ if(file_exists($thumb_image_del))
+ {
+ unlink($thumb_image_del);
+ }
+ }
+ }
+ }
+ }
+ }
}
\ No newline at end of file
diff --git a/application/admin/controller/AccountLogController.php b/application/admin/controller/AccountLogController.php
new file mode 100644
index 0000000..c3ca6b6
--- /dev/null
+++ b/application/admin/controller/AccountLogController.php
@@ -0,0 +1,53 @@
+SOURCE_TYPE;
+ $param = $request->param();
+
+ $where = [];
+ if(isset($param['source_type']) && $param['source_type']){
+ $source_type = $param['source_type'];
+ $where[] = ['source_type','in',$source_type];
+ }
+
+ if(isset($param['keyword']) && $param['keyword']){
+ $where[] = [$param['keyword_type'],'like','%'.$param['keyword'].'%'];
+ }
+ if (isset($param['start_time']) && $param['start_time'] && isset($param['end_time']) && $param['end_time']) {
+ $where[] = ['al.create_time', 'between', [strtotime($param['start_time']), strtotime($param['end_time'])]];
+ }
+ $model = $model
+ ->alias('al')
+ ->field('al.*,u.mobile,u.nickname,u.sn as user_sn,u.avatar')
+ ->join('user u', 'u.id = al.user_id')
+ ->where($where)
+ ->scope('where', $param);
+
+ $data = $model->paginate($this->admin['per_page'], false, ['query'=>$request->get()]);
+ //关键词,排序等赋值
+ $this->assign($request->get());
+
+ $this->assign([
+ 'data' => $data,
+ 'page' => $data->render(),
+ 'total' => $data->total(),
+ 'source_type_list'=>$SOURCE_TYPE,
+ ]);
+ return $this->fetch();
+ }
+}
diff --git a/application/admin/controller/ArticleCategoryController.php b/application/admin/controller/ArticleCategoryController.php
deleted file mode 100755
index 05643fb..0000000
--- a/application/admin/controller/ArticleCategoryController.php
+++ /dev/null
@@ -1,103 +0,0 @@
-getTreeList($model);
- $this->assign([
- 'data' => $data,
-
- ]);
- return $this->fetch();
- }
-
- //添加
- public function add(Request $request, ArticleCategory $model, ArticleCategoryValidate $validate)
- {
- if ($request->isPost()) {
- $param = $request->param();
- $validate_result = $validate->scene('add')->check($param);
- if (!$validate_result) {
- return error($validate->getError());
- }
-
- $result = $model::create($param);
-
- $url = URL_BACK;
- if (isset($param['_create']) && $param['_create'] == 1) {
- $url = URL_RELOAD;
- }
-
- return $result ? success('添加成功', $url) : error();
- }
-
- $this->assign([
- 'cat_list' => $model::where('parent_id', 0)->select(),
- ]);
-
- return $this->fetch();
- }
-
- //修改
- public function edit($id, Request $request, ArticleCategory $model, ArticleCategoryValidate $validate)
- {
-
- $data = $model::get($id);
- if ($request->isPost()) {
- $param = $request->param();
- $validate_result = $validate->scene('edit')->check($param);
- if (!$validate_result) {
- return error($validate->getError());
- }
-
- $result = $data->save($param);
- return $result ? success() : error();
- }
-
- $this->assign([
- 'data' => $data,
- 'cat_list' => $model::where('parent_id', 0)->select(),
-
- ]);
- return $this->fetch('add');
-
- }
-
- //删除
- public function del($id, ArticleCategory $model)
- {
- if (count($model->noDeletionId) > 0) {
- if (is_array($id)) {
- if (array_intersect($model->noDeletionId, $id)) {
- return error('ID为' . implode(',', $model->noDeletionId) . '的数据无法删除');
- }
- } else if (in_array($id, $model->noDeletionId)) {
- return error('ID为' . $id . '的数据无法删除');
- }
- }
-
- if ($model->softDelete) {
- $result = $model->whereIn('id', $id)->useSoftDelete('delete_time', time())->delete();
- } else {
- $result = $model->whereIn('id', $id)->delete();
- }
-
- return $result ? success('操作成功', URL_RELOAD) : error();
- }
-
-
-}
diff --git a/application/admin/controller/ArticleController.php b/application/admin/controller/ArticleController.php
deleted file mode 100755
index 57301b6..0000000
--- a/application/admin/controller/ArticleController.php
+++ /dev/null
@@ -1,141 +0,0 @@
-param();
- $model = $model->scope('where', $param);
-
- $data = $model->paginate($this->admin['per_page'], false, ['query'=>$request->get()]);
- //关键词,排序等赋值
- $this->assign($request->get());
-
- $this->assign([
- 'data' => $data,
- 'page' => $data->render(),
- 'total' => $data->total(),
- ]);
- return $this->fetch();
- }
-
- //添加
- public function add(Request $request, Article $model, ArticleValidate $validate)
- {
- if ($request->isPost()) {
- $param = $request->param();
- $validate_result = $validate->scene('add')->check($param);
- if (!$validate_result) {
- return error($validate->getError());
- }
- $param['content'] = $request->param(false)['content'];
-
-//处理缩略图上传
-$attachment_img = new \app\common\model\Attachment;
-$file_img = $attachment_img->upload('img');
-if ($file_img) {
- $param['img'] = $file_img->url;
-} else {
- return error($attachment_img->getError());
-}
-
-
- $result = $model::create($param);
-
- $url = URL_BACK;
- if(isset($param['_create']) && $param['_create']==1){
- $url = URL_RELOAD;
- }
-
- return $result ? success('添加成功',$url) : error();
- }
-
-
-
- return $this->fetch();
- }
-
- //修改
- public function edit($id, Request $request, Article $model, ArticleValidate $validate)
- {
-
- $data = $model::get($id);
- if ($request->isPost()) {
- $param = $request->param();
- $validate_result = $validate->scene('edit')->check($param);
- if (!$validate_result) {
- return error($validate->getError());
- }
- $param['content'] = $request->param(false)['content'];
-
-//处理缩略图上传
-if (!empty($_FILES['img']['name'])) {
- $attachment_img = new \app\common\model\Attachment;
- $file_img = $attachment_img->upload('img');
- if ($file_img) {
- $param['img'] = $file_img->url;
- }
-}
-
-
- $result = $data->save($param);
- return $result ? success() : error();
- }
-
- $this->assign([
- 'data' => $data,
-
- ]);
- return $this->fetch('add');
-
- }
-
- //删除
- public function del($id, Article $model)
- {
- if (count($model->noDeletionId) > 0) {
- if (is_array($id)) {
- if (array_intersect($model->noDeletionId, $id)) {
- return error('ID为' . implode(',', $model->noDeletionId) . '的数据无法删除');
- }
- } else if (in_array($id, $model->noDeletionId)) {
- return error('ID为' . $id . '的数据无法删除');
- }
- }
-
- if ($model->softDelete) {
- $result = $model->whereIn('id', $id)->useSoftDelete('delete_time', time())->delete();
- } else {
- $result = $model->whereIn('id', $id)->delete();
- }
-
- return $result ? success('操作成功', URL_RELOAD) : error();
- }
-
- //启用
-public function enable($id,Article $model)
-{
- $result = $model->whereIn('id',$id)->update(['status'=>1]);
- return $result ? success('操作成功', URL_RELOAD) : error();
-}
-
-
-//禁用
-public function disable($id,Article $model)
-{
- $result = $model->whereIn('id',$id)->update(['status'=>0]);
- return $result ? success('操作成功', URL_RELOAD) : error();
-}
-}
diff --git a/application/admin/controller/BrandController.php b/application/admin/controller/BrandController.php
deleted file mode 100755
index 0c5d5e1..0000000
--- a/application/admin/controller/BrandController.php
+++ /dev/null
@@ -1,123 +0,0 @@
-param();
- $model = $model->scope('where', $param);
-
- $data = $model->paginate($this->admin['per_page'], false, ['query' => $request->get()]);
- //关键词,排序等赋值
- $this->assign($request->get());
-
- $this->assign([
- 'data' => $data,
- 'page' => $data->render(),
- 'total' => $data->total(),
- ]);
- return $this->fetch();
- }
-
- //添加
- public function add(Request $request, Brand $model, BrandValidate $validate)
- {
- if ($request->isPost()) {
- $param = $request->param();
- $validate_result = $validate->scene('add')->check($param);
- if (!$validate_result) {
- return error($validate->getError());
- }
- //处理图片上传
- $attachment_img = new \app\common\model\Attachment;
- $file_img = $attachment_img->upload('img');
- if ($file_img) {
- $param['img'] = $file_img->url;
- } else {
- return error($attachment_img->getError());
- }
-
-
- $result = $model::create($param);
-
- $url = URL_BACK;
- if (isset($param['_create']) && $param['_create'] == 1) {
- $url = URL_RELOAD;
- }
-
- return $result ? success('添加成功', $url) : error();
- }
-
-
- return $this->fetch();
- }
-
- //修改
- public function edit($id, Request $request, Brand $model, BrandValidate $validate)
- {
-
- $data = $model::get($id);
- if ($request->isPost()) {
- $param = $request->param();
- $validate_result = $validate->scene('edit')->check($param);
- if (!$validate_result) {
- return error($validate->getError());
- }
- //处理图片上传
- if (!empty($_FILES['img']['name'])) {
- $attachment_img = new \app\common\model\Attachment;
- $file_img = $attachment_img->upload('img');
- if ($file_img) {
- $param['img'] = $file_img->url;
- }
- }
-
-
- $result = $data->save($param);
- return $result ? success() : error();
- }
-
- $this->assign([
- 'data' => $data,
-
- ]);
- return $this->fetch('add');
-
- }
-
- //删除
- public function del($id, Brand $model)
- {
- if (count($model->noDeletionId) > 0) {
- if (is_array($id)) {
- if (array_intersect($model->noDeletionId, $id)) {
- return error('ID为' . implode(',', $model->noDeletionId) . '的数据无法删除');
- }
- } else if (in_array($id, $model->noDeletionId)) {
- return error('ID为' . $id . '的数据无法删除');
- }
- }
-
- if ($model->softDelete) {
- $result = $model->whereIn('id', $id)->useSoftDelete('delete_time', time())->delete();
- } else {
- $result = $model->whereIn('id', $id)->delete();
- }
-
- return $result ? success('操作成功', URL_RELOAD) : error();
- }
-
-
-}
diff --git a/application/admin/controller/DeliverAddressController.php b/application/admin/controller/DeliverAddressController.php
deleted file mode 100755
index f7e6b4d..0000000
--- a/application/admin/controller/DeliverAddressController.php
+++ /dev/null
@@ -1,123 +0,0 @@
-param();
- $model = $model->with('user,province,city,district,street')->scope('where', $param);
-
- $data = $model->paginate($this->admin['per_page'], false, ['query' => $request->get()]);
- //关键词,排序等赋值
- $this->assign($request->get());
-
- $this->assign([
- 'data' => $data,
- 'page' => $data->render(),
- 'total' => $data->total(),
- ]);
- return $this->fetch();
- }
-
- //添加
- public function add(Request $request, DeliverAddress $model, DeliverAddressValidate $validate, Region $region)
- {
- if ($request->isPost()) {
- $param = $request->param();
- $validate_result = $validate->scene('add')->check($param);
- if (!$validate_result) {
- return error($validate->getError());
- }
-
- $result = $model::create($param);
-
- $url = URL_BACK;
- if (isset($param['_create']) && $param['_create'] == 1) {
- $url = URL_RELOAD;
- }
-
- return $result ? success('添加成功', $url) : error();
- }
-
- $this->assign([
- 'user_list' => User::all(),
- 'province_list' => $region->getProvince(),
- 'city_list' => $region->getCity(1),
- 'district_list' => $region->getDistrict(1),
- 'street_list' => $region->getStreet(1),
-
- ]);
-
-
- return $this->fetch();
- }
-
- //修改
- public function edit($id, Request $request, DeliverAddress $model, DeliverAddressValidate $validate, Region $region)
- {
-
- $data = $model::get($id);
- if ($request->isPost()) {
- $param = $request->param();
- $validate_result = $validate->scene('edit')->check($param);
- if (!$validate_result) {
- return error($validate->getError());
- }
-
- $result = $data->save($param);
- return $result ? success() : error();
- }
-
- $this->assign([
- 'data' => $data,
- 'user_list' => User::all(),
- 'province_list' => $region->getProvince(),
- 'city_list' => $region->getCity(1),
- 'district_list' => $region->getDistrict(1),
- 'street_list' => $region->getStreet(1),
-
-
- ]);
- return $this->fetch('add');
-
- }
-
- //删除
- public function del($id, DeliverAddress $model)
- {
- if (count($model->noDeletionId) > 0) {
- if (is_array($id)) {
- if (array_intersect($model->noDeletionId, $id)) {
- return error('ID为' . implode(',', $model->noDeletionId) . '的数据无法删除');
- }
- } else if (in_array($id, $model->noDeletionId)) {
- return error('ID为' . $id . '的数据无法删除');
- }
- }
-
- if ($model->softDelete) {
- $result = $model->whereIn('id', $id)->useSoftDelete('delete_time', time())->delete();
- } else {
- $result = $model->whereIn('id', $id)->delete();
- }
-
- return $result ? success('操作成功', URL_RELOAD) : error();
- }
-
-
-}
diff --git a/application/admin/controller/DemoController.php b/application/admin/controller/DemoController.php
deleted file mode 100755
index 9547577..0000000
--- a/application/admin/controller/DemoController.php
+++ /dev/null
@@ -1,175 +0,0 @@
-fetch();
- }
-
-
- //发送邮件功能
- public function sendEmail(Request $request)
- {
- $param = $request->param();
-
- $config = config('email.smtp');
- $mail = new PHPMailer(true); // Passing `true` enables exceptions
- try {
-
- $address = $param['address'];
- $subject = $param['subject'];
- $content = $param['content'];
- $full_content = $request->param(false)['content'];
-
- //服务器配置
- $mail->CharSet = "UTF-8"; //设定邮件编码
- $mail->SMTPDebug = 0; // 调试模式输出
- $mail->isSMTP(); // 使用SMTP
- $mail->Host = $config['host']; // SMTP服务器
- $mail->SMTPAuth = true; // 允许 SMTP 认证
- $mail->Username = $config['username']; // SMTP 用户名 即邮箱的用户名
- $mail->Password = $config['password']; // SMTP 密码 部分邮箱是授权码(例如163邮箱)
- $mail->SMTPSecure = 'ssl'; // 允许 TLS 或者ssl协议
- $mail->Port = 465; // 服务器端口 25 或者465 具体要看邮箱服务器支持
-
- $mail->setFrom($config['address'], $config['name']); //发件人
- $mail->addAddress($address, $address); // 收件人
- //$mail->addAddress('ellen@example.com'); // 可添加多个收件人
- $mail->addReplyTo($config['address'], $config['name']); //回复的时候回复给哪个邮箱 建议和发件人一致
- //$mail->addCC('cc@example.com'); //抄送
- //$mail->addBCC('bcc@example.com'); //密送
-
- //发送附件
- // $mail->addAttachment('../xy.zip'); // 添加附件
- //$mail->addAttachment(app()->getRootPath() . 'public/uploads/attachment/20190902/6a673f554c694a41971fca94c7503315.jpg', 'test.jpg'); // 发送附件并且重命名
-
- //Content
- $mail->isHTML(true); // 是否以HTML文档格式发送 发送后客户端可直接显示对应HTML内容
- $mail->Subject = $subject;
- $mail->Body = $full_content;
- $mail->AltBody = $content;
-
- $mail->send();
- $result = true;
- $msg = '邮件发送成功';
- } catch (\Exception $e) {
- $msg = '邮件发送失败,错误信息:' . $mail->ErrorInfo;
- $result = false;
- }
-
- return $result ? success('成功', URL_RELOAD, '') : error($msg);
- }
-
- //短信页面
- public function sms()
- {
- return $this->fetch();
- }
-
- //发送短信功能
- public function sendSms(Request $request)
- {
- $param = $request->param();
- $config = config('sms.');
- $easySms = new EasySms($config);
-
- try {
- $result = $easySms->send($param['mobile'], [
- 'template' => 'SMS_001',
- 'data' => [
- 'code' => 543260
- ],
- ]);
- $success = true;
- $msg = '发送成功';
- } catch (\Exception $e) {
- $success = false;
- $msg = $e->getMessage();
- }
-
- if (!$success || $result['aliyun']['status'] !== 'success') {
- return error($msg);
- }
-
- return success($msg);
- }
-
-
- //二维码页面
- public function qrCode()
- {
- return $this->fetch();
- }
-
-
- //生成二维码功能
- public function createQrCode(Request $request)
- {
- $param = $request->param();
-
- $content = $param['content'] ?? '麻烦输入内容OK?';
-
- //创建码,$content为二维码内容
- $qrCode = new QrCode($content);
- //设置尺寸
- $qrCode->setSize(300);
- //可以设置binary,png,svg,eps,debug
- $qrCode->setWriterByName('png');
- //设置边距
- $qrCode->setMargin(10);
- //编码
- $qrCode->setEncoding('UTF-8');
- //容错等级
- $qrCode->setErrorCorrectionLevel(new ErrorCorrectionLevel(ErrorCorrectionLevel::HIGH));
- //前景色
- $qrCode->setForegroundColor(['r' => 0, 'g' => 0, 'b' => 0, 'a' => 0]);
- //背景色
- $qrCode->setBackgroundColor(['r' => 255, 'g' => 255, 'b' => 255, 'a' => 0]);
- //标签
- $qrCode->setLabel('Admin Demo QrCode', 16, null, LabelAlignment::CENTER);
- //logo地址
-
-
- $qrCode->setLogoPath(app()->getRootPath() . 'public/uploads/attachment/20190902/6a673f554c694a41971fca94c7503315.jpg');
- //logo大小
- $qrCode->setLogoSize(100, 100);
- //块尺寸设置为整数,默认为true
- $qrCode->setRoundBlockSize(true);
- //验证结果
- $qrCode->setValidateResult(false);
- //写入选项
- $qrCode->setWriterOptions(['exclude_xml_declaration' => true]);
-
- //直接输出图片
- //header('Content-Type: '.$qrCode->getContentType());
- //return $qrCode->writeString();
-
- $file_name = random_int(1, 5);
- //保存成文件
- $qrCode->writeFile(app()->getRootPath() . 'public/demo/qrcode/' . $file_name . '.png');
- $code_url = '/demo/qrcode/' . $file_name . '.png';
-
- return success('生成成功', URL_CURRENT, ['qrcode' => $code_url]);
-
-
- // Create a response object
-
-
- }
-}
\ No newline at end of file
diff --git a/application/admin/controller/EditorController.php b/application/admin/controller/EditorController.php
deleted file mode 100755
index 8f8834f..0000000
--- a/application/admin/controller/EditorController.php
+++ /dev/null
@@ -1,24 +0,0 @@
-
- */
-
-namespace app\admin\controller;
-
-use think\Request;
-use tools\UEditor;
-
-class EditorController extends Controller
-{
-
- //编辑器上传等url
- public function server(Request $request)
- {
- $param = $request->param();
- $config = config('ueditor.');
- $action = $param['action'];
- $editor = new UEditor($config);
- return $editor->server($action);
- }
-}
\ No newline at end of file
diff --git a/application/admin/controller/ExpressController.php b/application/admin/controller/ExpressController.php
deleted file mode 100755
index b921405..0000000
--- a/application/admin/controller/ExpressController.php
+++ /dev/null
@@ -1,105 +0,0 @@
-param();
- $model = $model->scope('where', $param);
-
- $data = $model->paginate($this->admin['per_page'], false, ['query' => $request->get()]);
- //关键词,排序等赋值
- $this->assign($request->get());
-
- $this->assign([
- 'data' => $data,
- 'page' => $data->render(),
- 'total' => $data->total(),
- ]);
- return $this->fetch();
- }
-
- //添加
- public function add(Request $request, Express $model, ExpressValidate $validate)
- {
- if ($request->isPost()) {
- $param = $request->param();
- $validate_result = $validate->scene('add')->check($param);
- if (!$validate_result) {
- return error($validate->getError());
- }
-
- $result = $model::create($param);
-
- $url = URL_BACK;
- if (isset($param['_create']) && $param['_create'] == 1) {
- $url = URL_RELOAD;
- }
-
- return $result ? success('添加成功', $url) : error();
- }
-
-
- return $this->fetch();
- }
-
- //修改
- public function edit($id, Request $request, Express $model, ExpressValidate $validate)
- {
-
- $data = $model::get($id);
- if ($request->isPost()) {
- $param = $request->param();
- $validate_result = $validate->scene('edit')->check($param);
- if (!$validate_result) {
- return error($validate->getError());
- }
-
- $result = $data->save($param);
- return $result ? success() : error();
- }
-
- $this->assign([
- 'data' => $data,
-
- ]);
- return $this->fetch('add');
-
- }
-
- //删除
- public function del($id, Express $model)
- {
- if (count($model->noDeletionId) > 0) {
- if (is_array($id)) {
- if (array_intersect($model->noDeletionId, $id)) {
- return error('ID为' . implode(',', $model->noDeletionId) . '的数据无法删除');
- }
- } else if (in_array($id, $model->noDeletionId)) {
- return error('ID为' . $id . '的数据无法删除');
- }
- }
-
- if ($model->softDelete) {
- $result = $model->whereIn('id', $id)->useSoftDelete('delete_time', time())->delete();
- } else {
- $result = $model->whereIn('id', $id)->delete();
- }
-
- return $result ? success('操作成功', URL_RELOAD) : error();
- }
-
-
-}
diff --git a/application/admin/controller/FinanceController.php b/application/admin/controller/FinanceController.php
new file mode 100755
index 0000000..d5f77b5
--- /dev/null
+++ b/application/admin/controller/FinanceController.php
@@ -0,0 +1,24 @@
+
+ */
+
+namespace app\admin\controller;
+
+use app\admin\model\AdminLog;
+use app\admin\model\AdminMenu;
+use app\admin\model\AdminRole;
+use app\admin\model\AdminUser;
+use tools\SystemInfo;
+use think\Request;
+
+class FinanceController extends Controller
+{
+ public function lists(Request $request)
+ {
+ return $this->fetch();
+ }
+
+
+}
diff --git a/application/admin/controller/GoodsAttrCategoryController.php b/application/admin/controller/GoodsAttrCategoryController.php
deleted file mode 100755
index 207c406..0000000
--- a/application/admin/controller/GoodsAttrCategoryController.php
+++ /dev/null
@@ -1,170 +0,0 @@
-param();
- $model = $model->scope('where', $param);
-
- $data = $model->paginate($this->admin['per_page'], false, ['query'=>$request->get()]);
- //关键词,排序等赋值
- $this->assign($request->get());
-
- $this->assign([
- 'data' => $data,
- 'page' => $data->render(),
- 'total' => $data->total(),
- ]);
- return $this->fetch();
- }
-
- //添加
- public function add(Request $request, GoodsAttrCategory $model,GoodsAttr $gamodel, GoodsAttrCategoryValidate $validate)
- {
- if ($request->isPost()) {
- $param = $request->param();
- $validate_result = $validate->scene('add')->check($param);
- if (!$validate_result) {
- return error($validate->getError());
- }
- $attrcategory['name']=$param['name'];
- // 启动事务
- $model->startTrans();
- try{
- $result = $model::create($attrcategory);
- $class_id=$result->id;
- $field_data = [];
- foreach ($param['attr_name'] as $key => $value) {
- $field_data[] = [
- 'attr_name' => $param['attr_name'][$key][0],
- 'attr_class_id' => $class_id,
- 'attr_index' =>0,
- 'attr_values' =>'',
- 'sort_order' => $param['sort_order'][$key][0] ?? 255,
- ];
- }
- $gamodel::insertAll($field_data);
- // 提交事务
- $model->commit();
- }catch(\Exception $e){
- // 回滚事务
- $model->rollback();
- return error('添加失败');
- }
- $url = URL_BACK;
- if(isset($param['_create']) && $param['_create']==1){
- $url = URL_RELOAD;
- }
- return success('添加成功',$url);
- }
- $this->assign([
- 'gamodel_count'=>0,
- ]);
- return $this->fetch();
- }
-
-
- //修改
- public function edit($id, Request $request, GoodsAttrCategory $model,GoodsAttr $gamodel, GoodsAttrCategoryValidate $validate)
- {
-
- $data = $model::get($id);
- if ($request->isPost()) {
- $param = $request->param();
- $validate_result = $validate->scene('edit')->check($param);
- if (!$validate_result) {
- return error($validate->getError());
- }
- $attrcategory['name']=$param['name'];
- // 启动事务
- $model->startTrans();
- try{
- $model->where('id',$id)->update($attrcategory);
- $where[]=array('attr_class_id','=',$id);
- Db::table('goods_attr')->where($where)->delete();
- $field_data = [];
- foreach ($param['attr_name'] as $key => $value) {
- $field_data[] = [
- 'attr_name' => $param['attr_name'][$key][0],
- 'attr_class_id' => $id,
- 'attr_index' =>0,
- 'attr_values' =>'',
- 'sort_order' => $param['sort_order'][$key][0] ?? 255,
- ];
- }
- $gamodel::insertAll($field_data);
- // 提交事务
- $model->commit();
- }catch(\Exception $e){
- $msg='提交失败';
- // 回滚事务
- $model->rollback();
- return error($msg);//
- }
-
-
-
- $result = $data->save($param);
- return $result ? success() : error();
- }
- $gamodel_list=$gamodel->field('attr_name,sort_order')->where(array('attr_class_id'=>$id))->select();
- $gamodel_l=array();
- foreach ($gamodel_list as $k1 =>$v1) {
- $key=$k1+1;
- $gamodel_l[$key]['attr_name']=$v1['attr_name'];
- $gamodel_l[$key]['sort_order']=$v1['sort_order'];
- }
-
-
- $this->assign([
- 'data' => $data,
- 'gamodel_list'=>$gamodel_l,
- 'gamodel_count'=>count($gamodel_list),
- ]);
- return $this->fetch('add');
-
- }
-
- //删除
- public function del($id, GoodsAttrCategory $model)
- {
- if (count($model->noDeletionId) > 0) {
- if (is_array($id)) {
- if (array_intersect($model->noDeletionId, $id)) {
- return error('ID为' . implode(',', $model->noDeletionId) . '的数据无法删除');
- }
- } else if (in_array($id, $model->noDeletionId)) {
- return error('ID为' . $id . '的数据无法删除');
- }
- }
-
- if ($model->softDelete) {
- $result = $model->whereIn('id', $id)->useSoftDelete('delete_time', time())->delete();
- } else {
- $result = $model->whereIn('id', $id)->delete();
- }
-
- return $result ? success('操作成功', URL_RELOAD) : error();
- }
-
- //获取规格分类下的规格
- public function get_attr()
- {
-
- }
-
-}
diff --git a/application/admin/controller/GoodsController.php b/application/admin/controller/GoodsController.php
index 1e927e2..8fec781 100755
--- a/application/admin/controller/GoodsController.php
+++ b/application/admin/controller/GoodsController.php
@@ -7,6 +7,7 @@ namespace app\admin\controller;
use think\Request;
use app\common\model\Goods;
+use app\common\model\MallImage;
use app\common\model\GoodsCategory;
use app\common\model\Brand;
use app\common\model\GoodsAttrCategory;
@@ -20,7 +21,7 @@ class GoodsController extends Controller
public function index(Request $request, Goods $model)
{
$param = $request->param();
- $model = $model->with('goods_category,brand')->scope('where', $param);
+ $model = $model->with('goods_category')->scope('where', $param);
$data = $model->paginate($this->admin['per_page'], false, ['query' => $request->get()]);
//关键词,排序等赋值
@@ -35,7 +36,7 @@ class GoodsController extends Controller
}
//添加
- public function add(Request $request, Goods $model, GoodsValidate $validate)
+ public function add(Request $request, Goods $model,MallImage $mimode, GoodsValidate $validate)
{
if ($request->isPost()) {
$param = $request->param();
@@ -43,39 +44,39 @@ class GoodsController extends Controller
if (!$validate_result) {
return error($validate->getError());
}
- $param['attr'] = $request->param(false)['attr'];
$param['detail'] = $request->param(false)['detail'];
-
- //处理图片上传
- $attachment_img = new \app\common\model\Attachment;
- $file_img = $attachment_img->upload('img');
- if ($file_img) {
- $param['img'] = $file_img->url;
- } else {
- return error($attachment_img->getError());
+ // 启动事务
+ $model->startTrans();
+ try{
+ $model::create($param);
+ $goods_id=$model->getLastInsID();
+ goods_imgs_upload($goods_id,1,$param['ori_img'],$param['thumb_img'],$param['ori_fm_img'],$param['thumb_img_f']);
+ // 提交事务
+ $model->commit();
+ }catch(\Exception $e){
+ // 回滚事务
+ $model->rollback();
+ return error($e->getMessage());
}
- $result = $model::create($param);
-
$url = URL_BACK;
- if (isset($param['_create']) && $param['_create'] == 1) {
- $url = URL_RELOAD;
+ if(isset($param['_create']) && $param['_create']==1){
+ $url = URL_RELOAD;
}
- return $result ? success('添加成功', $url) : error();
+ return success('添加成功',$url);
}
$this->assign([
'goods_category_list' => $this->getSelectList(new GoodsCategory),
- 'brand_list' => Brand::all(),
'imgurl_list'=>array(),
]);
return $this->fetch();
}
//修改
- public function edit($id, Request $request, Goods $model, GoodsValidate $validate)
+ public function edit($id, Request $request, Goods $model ,MallImage $mimode, GoodsValidate $validate)
{
$data = $model::get($id);
@@ -85,29 +86,39 @@ class GoodsController extends Controller
if (!$validate_result) {
return error($validate->getError());
}
- $param['attr'] = $request->param(false)['attr'];
$param['detail'] = $request->param(false)['detail'];
-
- //处理图片上传
- if (!empty($_FILES['img']['name'])) {
- $attachment_img = new \app\common\model\Attachment;
- $file_img = $attachment_img->upload('img');
- if ($file_img) {
- $param['img'] = $file_img->url;
- }
+ // 启动事务
+ $model->startTrans();
+ try{
+ $data->save($param);
+ $MallImage=$mimode->where(array('type'=>1,'union_id'=>$id))->select();
+ goods_imgs_upload($id,1,$param['ori_img'],$param['thumb_img'],$param['ori_fm_img'],$param['thumb_img_f'],$MallImage);
+ // 提交事务
+ $model->commit();
+ }catch(\Exception $e){
+ // 回滚事务
+ $model->rollback();
+ return error($e->getMessage());
+ }
+ return success();
+ }
+ $ori_img='';
+ $thumb_img='';
+ $imgurl_list=$mimode->field('thumb_image,ori_image,is_cover')->where(array('type'=>1,'union_id'=>$id))->select();
+ foreach ($imgurl_list as $key => $v) {
+ $is_cover=$v['is_cover']>0 ? $v['is_cover']:'0';
+ if ($is_cover == 1) {
+ $ori_img = $v['ori_image'];
+ $thumb_img = $v['thumb_image'];
}
-
- $result = $data->save($param);
- return $result ? success() : error();
}
-
$this->assign([
'data' => $data,
'goods_category_list' => $this->getSelectList(new GoodsCategory, $data->goods_category_id),
- 'brand_list' => Brand::all(),
- 'goodsattrcategory_list' => GoodsAttrCategory::all(),
- 'imgurl_list'=>array(),
+ 'ori_img'=>$ori_img,
+ 'thumb_img'=>$thumb_img,
+ 'imgurl_list'=>$imgurl_list,
]);
return $this->fetch('add');
diff --git a/application/admin/controller/IndexController.php b/application/admin/controller/IndexController.php
index 5d80b33..af6f6ea 100755
--- a/application/admin/controller/IndexController.php
+++ b/application/admin/controller/IndexController.php
@@ -12,49 +12,91 @@ use app\admin\model\AdminRole;
use app\admin\model\AdminUser;
use tools\SystemInfo;
use think\Request;
+use think\Db;
class IndexController extends Controller
{
public function index(Request $request)
{
- //默认密码修改检测
- $password_danger = 0;
- if (config('admin.password_warning') && $this->user->id == 1 && password_verify('super-admin', $this->user->password)) {
- $password_danger = 1;
+
+ //更新时间
+ $time = date('Y-m-d H:i:s', time());
+ //今日成交订单
+ $order_num_today = Db::name('order')
+ ->where(['order_type' =>1])
+ ->whereTime('create_time', 'today')
+ ->count();
+ //昨日
+ $order_num_yesterday = Db::name('order')
+ ->where(['order_type' =>1])
+ ->whereTime('create_time', 'yesterday')
+ ->count();
+ //变化
+ $order_num_change = $order_num_today - $order_num_yesterday;
+ if ($order_num_change >= 0) {
+ $order_num_change = '+' . $order_num_change;
+ }
+ //总
+ $order_num_all = Db::name('order')
+ ->where(['order_type' =>1])
+ ->count();
+ //今日销售金额(元)
+ $order_amount_today = Db::name('order')
+ ->where(['order_type' =>1])
+ ->whereTime('create_time', 'today')
+ ->sum('order_price');
+ //昨日
+ $order_amount_yesterday = Db::name('order')
+ ->where(['order_type' =>1])
+ ->whereTime('create_time', 'yesterday')
+ ->sum('order_price');
+ //总
+ $order_amount_all = Db::name('order')
+ ->where(['order_type' =>1])
+ ->sum('order_price');
+ //变化
+ $order_amount_change = $order_amount_today - $order_amount_yesterday;
+ if ($order_amount_change >= 0) {
+ $order_amount_change = '+' . $order_amount_change;
}
- /**
- * 首页数据展示,可自行替换
- */
- $this->assign([
- //后台用户数量
- 'admin_user_count' => AdminUser::count(),
- //后台角色数量
- 'admin_role_count' => AdminRole::count(),
- //后台菜单数量
- 'admin_menu_count' => AdminMenu::count(),
- //后台日志数量
- 'admin_log_count' => AdminLog::count(),
- ]);
- //是否显示欢迎信息
- $welcome_info = config('admin.welcome_info');
- if ($welcome_info) {
- $this->admin['name'] = config('admin.name');
+ // 今天新增会员数量
+ $add_user_today = Db::name('user')
+ ->whereTime('create_time', 'today')
+ ->count();
+ //昨天
+ $add_user_yesterday = Db::name('user')
+ ->whereTime('create_time', 'yesterday')
+ ->count();
+ //总
+ $user_all = Db::name('user')
+ ->count();
+ //变化
+ $add_change = $add_user_today - $add_user_yesterday;
+ if ($add_change >= 0) {
+ $add_change = '+' . $add_change;
}
+ $date=[
+ 'time' => $time,
+ 'order_num_today' => $order_num_today,
+ 'order_num_yesterday' => $order_num_yesterday,
+ 'order_num_change' => $order_num_change,
+ 'order_amount_today' => $order_amount_today,
+ 'order_amount_yesterday' => $order_amount_yesterday,
+ 'order_amount_change' => $order_amount_change,
+ 'add_user_today' => $add_user_today,
+ 'add_user_yesterday' => $add_user_yesterday,
+ 'add_user_change' => $add_change,
+
+ 'order_num_all' => $order_num_all,
+ 'order_amount_all' => $order_amount_all,
+ 'user_all' => $user_all,
+ ];
$this->assign([
- //系统信息
- 'system_info' => SystemInfo::getSystemInfo(),
- //访问信息
- 'visitor_info' => $request,
- //默认密码警告
- 'password_danger' => $password_danger,
- //当前用户
- 'user' => $this->user,
- //欢迎信息
- 'welcome_info' => $welcome_info
+ 'res'=>$date,
]);
return $this->fetch();
}
diff --git a/application/admin/controller/OrderController.php b/application/admin/controller/OrderController.php
index 607fcaf..b211d5b 100755
--- a/application/admin/controller/OrderController.php
+++ b/application/admin/controller/OrderController.php
@@ -5,15 +5,10 @@
namespace app\admin\controller;
-use app\common\model\DeliverAddress;
-use app\common\model\Express;
-use app\common\model\Goods;
-use app\common\model\Order;
-use app\common\model\OrderGoods;
-use app\common\model\User;
-use app\common\validate\OrderValidate;
-use think\Db;
use think\Request;
+use app\common\model\Order;
+
+use app\common\validate\OrderValidate;
class OrderController extends Controller
{
@@ -22,9 +17,53 @@ class OrderController extends Controller
public function index(Request $request, Order $model)
{
$param = $request->param();
- $model = $model->with('user,express')->scope('where', $param);
+ $where = [];
+ //订单搜素
+ if (!empty($param['search_key']) && !empty($param['keyword'])) {
+ $keyword = $param['keyword'];
+ switch ($param['search_key']) {
+ case 'order_sn':
+ $where[] = ['o.order_sn', 'like', '%' . $keyword . '%'];
+ break;
+ case 'user_sn':
+ $where[] = ['u.sn', 'like', '%' . $keyword . '%'];
+ break;
+ case 'nickname':
+ $where[] = ['u.nickname', 'like', '%' . $keyword . '%'];
+ break;
+ case 'user_mobile':
+ $where[] = ['u.mobile', 'like', '%' . $keyword . '%'];
+ break;
+ }
+ }
- $data = $model->paginate($this->admin['per_page'], false, ['query' => $request->get()]);
+ //商品名称
+ if (isset($param['goods_name']) && $param['goods_name'] != '') {
+ $where[] = ['o.goods_name', 'like', '%' . $param['goods_name'] . '%'];
+ }
+
+ //订单类型
+ if (isset($param['order_type']) && $param['order_type'] != '') {
+ $where[] = ['o.order_type', '=', $param['order_type']];
+ }
+
+ //下单时间
+ if (isset($param['start_time']) && $param['start_time'] != '') {
+ $where[] = ['o.create_time', '>=', strtotime($param['start_time'])];
+ }
+ if (isset($param['end_time']) && $param['end_time'] != '') {
+ $where[] = ['o.create_time', '<=', strtotime($param['end_time'])];
+ }
+ $model = $model
+ ->alias('o')
+ ->field('o.*,u.mobile,u.nickname,u.sn,u.avatar')
+ ->join('user u', 'u.id = o.user_id')
+ ->where($where)
+ ->order('o.id desc')
+ ->group('o.id')
+ ->scope('where', $param);
+
+ $data = $model->paginate($this->admin['per_page'], false, ['query'=>$request->get()]);
//关键词,排序等赋值
$this->assign($request->get());
@@ -35,95 +74,4 @@ class OrderController extends Controller
]);
return $this->fetch();
}
-
- //添加
- public function add(Request $request, Order $model, OrderValidate $validate)
- {
- if ($request->isPost()) {
- $param = $request->param();
- $validate_result = $validate->scene('add')->check($param);
- if (!$validate_result) {
- return error($validate->getError());
- }
-
- $result = $model::create($param);
-
- $url = URL_BACK;
- if (isset($param['_create']) && $param['_create'] == 1) {
- $url = URL_RELOAD;
- }
-
- return $result ? success('添加成功', $url) : error();
- }
-
- $this->assign([
- 'user_list' => User::all(),
- 'express_list' => Express::all(),
-
- ]);
-
-
- return $this->fetch();
- }
-
- //修改
- public function edit($id, Request $request, Order $model, OrderValidate $validate)
- {
-
- $data = $model::get($id);
- if ($request->isPost()) {
- $param = $request->param();
- $validate_result = $validate->scene('edit')->check($param);
- if (!$validate_result) {
- return error($validate->getError());
- }
-
- $result = $data->save($param);
- return $result ? success() : error();
- }
-
- $this->assign([
- 'data' => $data,
- 'user_list' => User::all(),
- 'express_list' => Express::all(),
-
- ]);
- return $this->fetch('add');
-
- }
-
- //删除
- public function del($id, Order $model)
- {
- if (count($model->noDeletionId) > 0) {
- if (is_array($id)) {
- if (array_intersect($model->noDeletionId, $id)) {
- return error('ID为' . implode(',', $model->noDeletionId) . '的数据无法删除');
- }
- } else if (in_array($id, $model->noDeletionId)) {
- return error('ID为' . $id . '的数据无法删除');
- }
- }
-
- if ($model->softDelete) {
- $result = $model->whereIn('id', $id)->useSoftDelete('delete_time', time())->delete();
- } else {
- $result = $model->whereIn('id', $id)->delete();
- }
-
- return $result ? success('操作成功', URL_RELOAD) : error();
- }
-
-
- //订单详情
- public function detail($id, Order $model)
- {
- $data = $model::get($id);
- $this->assign([
- 'data' => $data
- ]);
-
- return $this->fetch();
- }
-
}
diff --git a/application/admin/controller/ShopConfigController.php b/application/admin/controller/ShopConfigController.php
new file mode 100644
index 0000000..56adf26
--- /dev/null
+++ b/application/admin/controller/ShopConfigController.php
@@ -0,0 +1,125 @@
+isPost()) {
+ $param = $request->param();
+ ShopConfig::set('shouyi', 'time', $param['time']);
+ ShopConfig::set('shouyi', 'num', $param['num']);
+ $url = URL_RELOAD;
+ return success('添加成功',$url);
+ }
+ $config = [
+ 'time' => ShopConfig::get('shouyi', 'time'),
+ 'num' => ShopConfig::get('shouyi', 'num'),
+ ];
+ $this->assign([
+ 'config' => $config,
+ ]);
+ return $this->fetch();
+ }
+
+ //分销管理
+ public function fenxiao(Request $request, ShopConfig $model, ShopConfigValidate $validate)
+ {
+ if ($request->isPost()) {
+ $param = $request->param();
+ ShopConfig::set('fenxiao', 'first_ratio', $param['first_ratio']);
+ ShopConfig::set('fenxiao', 'second_ratio', $param['second_ratio']);
+ ShopConfig::set('fenxiao', 'number', $param['number']);
+ $url = URL_RELOAD;
+ return success('添加成功',$url);
+ }
+ $config = [
+ 'first_ratio' => ShopConfig::get('fenxiao', 'first_ratio'),
+ 'second_ratio' => ShopConfig::get('fenxiao', 'second_ratio'),
+ 'number' => ShopConfig::get('fenxiao', 'number'),
+ ];
+ $this->assign([
+ 'config' => $config,
+ ]);
+ return $this->fetch();
+ }
+
+ //政策协议
+ public function policy(Request $request, ShopConfig $model, ShopConfigValidate $validate)
+ {
+ if ($request->isPost()) {
+ $param = $request->param();
+ ShopConfig::set('policy', 'integral_rule', $param['integral_rule']);
+ $url = URL_RELOAD;
+ return success('添加成功',$url);
+ }
+ $config = [
+ 'integral_rule' => ShopConfig::get('policy', 'integral_rule'),
+ ];
+ $this->assign([
+ 'config' => $config,
+ ]);
+ return $this->fetch();
+ }
+
+ //会员提现
+ public function withdraw(Request $request, ShopConfig $model, ShopConfigValidate $validate)
+ {
+ if ($request->isPost()) {
+ $param = $request->param();
+ ShopConfig::set('withdraw', 'min_withdraw', $param['min_withdraw']);
+ ShopConfig::set('withdraw', 'max_withdraw', $param['max_withdraw']);
+ ShopConfig::set('withdraw', 'poundage', $param['poundage']);
+ $url = URL_RELOAD;
+ return success('添加成功',$url);
+ }
+ $config = [
+ 'min_withdraw' => ShopConfig::get('withdraw', 'min_withdraw'),
+ 'max_withdraw' => ShopConfig::get('withdraw', 'max_withdraw'),
+ 'poundage' => ShopConfig::get('withdraw', 'poundage'),
+ ];
+ $this->assign([
+ 'config' => $config,
+ ]);
+ return $this->fetch();
+ }
+
+ //试用设备设置
+ public function goods(Request $request, Goods $gmodel, ShopConfigValidate $validate)
+ {
+ if ($request->isPost()) {
+ $param = $request->param();
+ ShopConfig::set('goods', 'goods_id', $param['goods_id']);
+ ShopConfig::set('goods', 'day', $param['day']);
+ ShopConfig::set('goods', 'is_withdraw', $param['is_withdraw']);
+ ShopConfig::set('goods', 'is_first', $param['is_first']);
+ ShopConfig::set('goods', 'is_open', $param['is_open']);
+ $url = URL_RELOAD;
+ return success('添加成功',$url);
+ }
+ $config = [
+ 'goods_id' => ShopConfig::get('goods', 'goods_id'),
+ 'day' => ShopConfig::get('goods', 'day'),
+ 'is_withdraw' => ShopConfig::get('goods', 'is_withdraw'),
+ 'is_first' => ShopConfig::get('goods', 'is_first'),
+ 'is_open' => ShopConfig::get('goods', 'is_open'),
+ 'goods_list'=>Goods::all(),
+ ];
+ $this->assign([
+ 'config' => $config,
+ ]);
+ return $this->fetch();
+ }
+}
diff --git a/application/admin/controller/TagController.php b/application/admin/controller/TagController.php
deleted file mode 100755
index 91560d7..0000000
--- a/application/admin/controller/TagController.php
+++ /dev/null
@@ -1,105 +0,0 @@
-param();
- $model = $model->scope('where', $param);
-
- $data = $model->paginate($this->admin['per_page'], false, ['query' => $request->get()]);
- //关键词,排序等赋值
- $this->assign($request->get());
-
- $this->assign([
- 'data' => $data,
- 'page' => $data->render(),
- 'total' => $data->total(),
- ]);
- return $this->fetch();
- }
-
- //添加
- public function add(Request $request, Tag $model, TagValidate $validate)
- {
- if ($request->isPost()) {
- $param = $request->param();
- $validate_result = $validate->scene('add')->check($param);
- if (!$validate_result) {
- return error($validate->getError());
- }
-
- $result = $model::create($param);
-
- $url = URL_BACK;
- if (isset($param['_create']) && $param['_create'] == 1) {
- $url = URL_RELOAD;
- }
-
- return $result ? success('添加成功', $url) : error();
- }
-
-
- return $this->fetch();
- }
-
- //修改
- public function edit($id, Request $request, Tag $model, TagValidate $validate)
- {
-
- $data = $model::get($id);
- if ($request->isPost()) {
- $param = $request->param();
- $validate_result = $validate->scene('edit')->check($param);
- if (!$validate_result) {
- return error($validate->getError());
- }
-
- $result = $data->save($param);
- return $result ? success() : error();
- }
-
- $this->assign([
- 'data' => $data,
-
- ]);
- return $this->fetch('add');
-
- }
-
- //删除
- public function del($id, Tag $model)
- {
- if (count($model->noDeletionId) > 0) {
- if (is_array($id)) {
- if (array_intersect($model->noDeletionId, $id)) {
- return error('ID为' . implode(',', $model->noDeletionId) . '的数据无法删除');
- }
- } else if (in_array($id, $model->noDeletionId)) {
- return error('ID为' . $id . '的数据无法删除');
- }
- }
-
- if ($model->softDelete) {
- $result = $model->whereIn('id', $id)->useSoftDelete('delete_time', time())->delete();
- } else {
- $result = $model->whereIn('id', $id)->delete();
- }
-
- return $result ? success('操作成功', URL_RELOAD) : error();
- }
-
-
-}
diff --git a/application/admin/controller/TestController.php b/application/admin/controller/TestController.php
deleted file mode 100755
index 539ce69..0000000
--- a/application/admin/controller/TestController.php
+++ /dev/null
@@ -1,131 +0,0 @@
-param();
- $model = $model->scope('where', $param);
- if (isset($param['export_data']) && $param['export_data'] == 1) {
- $header = ['ID','',];
- $body = [];
- $data = $model->select();
- foreach ($data as $item) {
- $record = [];
- $record['id'] = $item->id;
-$record['name'] = $item->name;
-
- $body[] = $record;
- }
- return $this->exportData($header, $body, 'test-' . date('Y-m-d-H-i-s'));
-}
- $data = $model->paginate($this->admin['per_page'], false, ['query'=>$request->get()]);
- //关键词,排序等赋值
- $this->assign($request->get());
-
- $this->assign([
- 'data' => $data,
- 'page' => $data->render(),
- 'total' => $data->total(),
- ]);
- return $this->fetch();
- }
-
- //添加
- public function add(Request $request, Test $model, TestValidate $validate)
- {
- if ($request->isPost()) {
- $param = $request->param();
- $validate_result = $validate->scene('add')->check($param);
- if (!$validate_result) {
- return error($validate->getError());
- }
-
- $result = $model::create($param);
-
- $url = URL_BACK;
- if(isset($param['_create']) && $param['_create']==1){
- $url = URL_RELOAD;
- }
-
- return $result ? success('添加成功',$url) : error();
- }
-
-
-
- return $this->fetch();
- }
-
- //修改
- public function edit($id, Request $request, Test $model, TestValidate $validate)
- {
-
- $data = $model::get($id);
- if ($request->isPost()) {
- $param = $request->param();
- $validate_result = $validate->scene('edit')->check($param);
- if (!$validate_result) {
- return error($validate->getError());
- }
-
- $result = $data->save($param);
- return $result ? success() : error();
- }
-
- $this->assign([
- 'data' => $data,
-
- ]);
- return $this->fetch('add');
-
- }
-
- //删除
- public function del($id, Test $model)
- {
- if (count($model->noDeletionId) > 0) {
- if (is_array($id)) {
- if (array_intersect($model->noDeletionId, $id)) {
- return error('ID为' . implode(',', $model->noDeletionId) . '的数据无法删除');
- }
- } else if (in_array($id, $model->noDeletionId)) {
- return error('ID为' . $id . '的数据无法删除');
- }
- }
-
- if ($model->softDelete) {
- $result = $model->whereIn('id', $id)->useSoftDelete('delete_time', time())->delete();
- } else {
- $result = $model->whereIn('id', $id)->delete();
- }
-
- return $result ? success('操作成功', URL_RELOAD) : error();
- }
-
- //启用
-public function enable($id,Test $model)
-{
- $result = $model->whereIn('id',$id)->update(['status'=>1]);
- return $result ? success('操作成功', URL_RELOAD) : error();
-}
-
-
-//禁用
-public function disable($id,Test $model)
-{
- $result = $model->whereIn('id',$id)->update(['status'=>0]);
- return $result ? success('操作成功', URL_RELOAD) : error();
-}
-}
diff --git a/application/admin/controller/UserController.php b/application/admin/controller/UserController.php
index 33b1d18..9af8180 100755
--- a/application/admin/controller/UserController.php
+++ b/application/admin/controller/UserController.php
@@ -7,9 +7,11 @@ namespace app\admin\controller;
use think\Request;
use app\common\model\User;
-use app\common\model\UserLevel;
+use app\common\model\Order;
+use app\common\model\Goods;
use app\common\validate\UserValidate;
+use app\common\validate\OrderValidate;
class UserController extends Controller
{
@@ -18,27 +20,45 @@ class UserController extends Controller
public function index(Request $request, User $model)
{
$param = $request->param();
- $model = $model->with('user_level')->scope('where', $param);
- if (isset($param['export_data']) && $param['export_data'] == 1) {
- $header = ['ID', '头像', '用户等级', '用户名', '手机号', '昵称', '是否启用', '创建时间',];
- $body = [];
- $data = $model->select();
- foreach ($data as $item) {
- $record = [];
- $record['id'] = $item->id;
- $record['avatar'] = $item->avatar;
- $record['user_level_id'] = $item->user_level->name ?? '';
- $record['username'] = $item->username;
- $record['mobile'] = $item->mobile;
- $record['nickname'] = $item->nickname;
- $record['status'] = $item->status_text;
- $record['create_time'] = $item->create_time;
-
- $body[] = $record;
- }
- return $this->exportData($header, $body, 'user-' . date('Y-m-d-H-i-s'));
+ $where = [];
+ //查询
+ if(isset($param['keyword']) && $param['keyword']){
+ $where[] = [$param['keyword_type'],'like','%'.$param['keyword'].'%'];
}
+ //等级查询
+ if(isset($param['level']) && $param['level'] != ''){
+ $where[] = ['user_level_id','=',$param['level']];
+ }
+ //提现积分
+ if(isset($param['integral_start']) && $param['integral_start']){
+ $where[] = ['integral','>=',$param['integral_start']];
+ }
+ if(isset($param['integral_end']) && $param['integral_end']){
+ $where[] = ['integral','<=',$param['integral_end']];
+ }
+ //注册时间
+ if(isset($param['start_time']) && $param['start_time']!=''){
+ $where[] = ['create_time','>=',strtotime($param['start_time'])];
+ }
+ if(isset($param['end_time']) && $param['end_time']!=''){
+ $where[] = ['create_time','<=',strtotime($param['end_time'])];
+ }
+
+ $model = $model->where($where)->scope('where', $param);
$data = $model->paginate($this->admin['per_page'], false, ['query' => $request->get()]);
+ foreach ($data as $key => $value) {
+ // 上级推荐人
+ $value['first_leader_info'] = User::getUserInfo($value['first_leader']);
+ //推荐下级人数
+ $value['fans'] = User::where([
+ ['first_leader|second_leader', '=', $value['id']]
+ ])->count();
+
+ //设备数量
+ $value['sb_num'] = Order::where([
+ ['user_id', '=', $value['id']]
+ ])->count();
+ }
//关键词,排序等赋值
$this->assign($request->get());
@@ -78,13 +98,6 @@ class UserController extends Controller
return $result ? success('添加成功', $url) : error();
}
-
- $this->assign([
- 'user_level_list' => UserLevel::all(),
-
- ]);
-
-
return $this->fetch();
}
@@ -115,8 +128,6 @@ class UserController extends Controller
$this->assign([
'data' => $data,
- 'user_level_list' => UserLevel::all(),
-
]);
return $this->fetch('add');
@@ -157,4 +168,47 @@ class UserController extends Controller
$result = $model->whereIn('id', $id)->update(['status' => 0]);
return $result ? success('操作成功', URL_RELOAD) : error();
}
+
+
+ //分配设备
+ public function equipmentadd(Request $request,Order $omodel)
+ {
+ if ($request->isPost()) {
+ $param = $request->param();
+ $goods_ids=$param['goods_id'];
+ if(count($goods_ids)==0){
+ return error('请选择设备信息');
+ }
+ $field_data = array();
+ foreach ($goods_ids as $key => $value) {
+ if($param['goods_id'][$key][0] && $param['number'][$key][0] && $param['end_time'][$key][0]){
+ $goods_info=Goods::where(array('id'=>$param['goods_id'][$key][0]))->find()->toArray();
+ $field_data[] = [
+ 'order_no'=>get_order_sn(),
+ 'goods_id' => $param['goods_id'][$key][0],
+ 'number' => $param['number'][$key][0],
+ 'end_time' => strtotime($param['end_time'][$key][0]),
+ 'user_id' => $param['id'],
+ 'goods_name' => $goods_info['name'],
+ 'attr' => $goods_info['attr'],
+ 'order_price' => $goods_info['price']*$param['number'][$key][0],
+ 'create_time'=>time(),
+ ];
+ }
+ }
+ if(count($field_data)==0){
+ return error('请检查设备信息是否填写完整');
+ }
+ $result = $omodel->insertAll($field_data);
+ $url = URL_BACK;
+ if (isset($param['_create']) && $param['_create'] == 1) {
+ $url = URL_RELOAD;
+ }
+ return $result ? success('添加成功', $url) : error();
+ }
+ $this->assign([
+ 'goods_list' => Goods::all(),
+ ]);
+ return $this->fetch();
+ }
}
diff --git a/application/admin/controller/UserLevelController.php b/application/admin/controller/UserLevelController.php
deleted file mode 100755
index 70f6550..0000000
--- a/application/admin/controller/UserLevelController.php
+++ /dev/null
@@ -1,152 +0,0 @@
-param();
- $model = $model->scope('where', $param);
- if (isset($param['export_data']) && $param['export_data'] == 1) {
- $header = ['ID', '名称', '简介', '图片', '是否启用', '创建时间',];
- $body = [];
- $data = $model->select();
- foreach ($data as $item) {
- $record = [];
- $record['id'] = $item->id;
- $record['name'] = $item->name;
- $record['description'] = $item->description;
- $record['img'] = $item->img;
- $record['status'] = $item->status_text;
- $record['create_time'] = $item->create_time;
-
- $body[] = $record;
- }
- return $this->exportData($header, $body, 'user_level-' . date('Y-m-d-H-i-s'));
- }
- $data = $model->paginate($this->admin['per_page'], false, ['query' => $request->get()]);
- //关键词,排序等赋值
- $this->assign($request->get());
-
- $this->assign([
- 'data' => $data,
- 'page' => $data->render(),
- 'total' => $data->total(),
- ]);
- return $this->fetch();
- }
-
- //添加
- public function add(Request $request, UserLevel $model, UserLevelValidate $validate)
- {
- if ($request->isPost()) {
- $param = $request->param();
- $validate_result = $validate->scene('add')->check($param);
- if (!$validate_result) {
- return error($validate->getError());
- }
- //处理图片上传
- $attachment_img = new \app\common\model\Attachment;
- $file_img = $attachment_img->upload('img');
- if ($file_img) {
- $param['img'] = $file_img->url;
- } else {
- return error($attachment_img->getError());
- }
-
-
- $result = $model::create($param);
-
- $url = URL_BACK;
- if (isset($param['_create']) && $param['_create'] == 1) {
- $url = URL_RELOAD;
- }
-
- return $result ? success('添加成功', $url) : error();
- }
-
-
- return $this->fetch();
- }
-
- //修改
- public function edit($id, Request $request, UserLevel $model, UserLevelValidate $validate)
- {
-
- $data = $model::get($id);
- if ($request->isPost()) {
- $param = $request->param();
- $validate_result = $validate->scene('edit')->check($param);
- if (!$validate_result) {
- return error($validate->getError());
- }
- //处理图片上传
- if (!empty($_FILES['img']['name'])) {
- $attachment_img = new \app\common\model\Attachment;
- $file_img = $attachment_img->upload('img');
- if ($file_img) {
- $param['img'] = $file_img->url;
- }
- }
-
-
- $result = $data->save($param);
- return $result ? success() : error();
- }
-
- $this->assign([
- 'data' => $data,
-
- ]);
- return $this->fetch('add');
-
- }
-
- //删除
- public function del($id, UserLevel $model)
- {
- if (count($model->noDeletionId) > 0) {
- if (is_array($id)) {
- if (array_intersect($model->noDeletionId, $id)) {
- return error('ID为' . implode(',', $model->noDeletionId) . '的数据无法删除');
- }
- } else if (in_array($id, $model->noDeletionId)) {
- return error('ID为' . $id . '的数据无法删除');
- }
- }
-
- if ($model->softDelete) {
- $result = $model->whereIn('id', $id)->useSoftDelete('delete_time', time())->delete();
- } else {
- $result = $model->whereIn('id', $id)->delete();
- }
-
- return $result ? success('操作成功', URL_RELOAD) : error();
- }
-
- //启用
- public function enable($id, UserLevel $model)
- {
- $result = $model->whereIn('id', $id)->update(['status' => 1]);
- return $result ? success('操作成功', URL_RELOAD) : error();
- }
-
-
- //禁用
- public function disable($id, UserLevel $model)
- {
- $result = $model->whereIn('id', $id)->update(['status' => 0]);
- return $result ? success('操作成功', URL_RELOAD) : error();
- }
-}
diff --git a/application/admin/controller/WeChatController.php b/application/admin/controller/WeChatController.php
deleted file mode 100755
index da7d4d3..0000000
--- a/application/admin/controller/WeChatController.php
+++ /dev/null
@@ -1,159 +0,0 @@
-fetch();
- }
-
- //服务端验证
- public function server()
- {
- $config = config('wechat.');
-
- $app = Factory::officialAccount($config);
-
- $response = $app->server->serve();
-
- // 将响应输出
- return $response->send();
- }
-
- //接收 & 回复用户消息
- public function msg()
- {
- $config = config('wechat.');
-
- $app = Factory::officialAccount($config);
-
- $app->server->push(function ($message) {
- return "你好哇";
- });
-
- $response = $app->server->serve();
-
- // 将响应输出
- $response->send(); // Laravel 里请使用:return $response;
- }
-
- //获取用户信息
- public function user()
- {
- $config = config('wechat.');
-
- $app = Factory::officialAccount($config);
- $user = $app->user->get('用户的openID');
-
- }
-
-
- //发送模版消息
- public function templateMsg()
- {
- $config = config('wechat.');
-
- $app = Factory::officialAccount($config);
-
- $app->template_message->send([
- 'touser' => 'user-openid',
- 'template_id' => 'template-id',
- 'url' => 'https://easywechat.org',
- 'miniprogram' => [
- 'appid' => 'xxxxxxx',
- 'pagepath' => 'pages/xxx',
- ],
- 'data' => [
- 'key1' => 'VALUE',
- 'key2' => 'VALUE2',
- ],
- ]);
- }
-
-
- //拉黑用户
- public function block()
- {
- $config = config('wechat.');
-
- $app = Factory::officialAccount($config);
-
- $app->user->block('openidxxxxx');
- // 或者多个用户
- $app->user->block(['openid1', 'openid2', 'openid3',]);
- }
-
-
- //统一下单
- public function pay()
- {
- $config = config('wechat.');
- $app = Factory::payment($config);
- $result = $app->order->unify([
- 'body' => '腾讯充值中心-QQ会员充值',
- 'out_trade_no' => '20150806125346',
- 'total_fee' => 88,
- 'spbill_create_ip' => '123.12.12.123', // 可选,如不传该参数,SDK 将会自动获取相应 IP 地址
- 'notify_url' => 'https://pay.weixin.qq.com/wxpay/pay.action', // 支付结果通知网址,如果不设置则会使用配置里的默认地址
- 'trade_type' => 'JSAPI', // 请对应换成你的支付方式对应的值类型
- 'openid' => 'oUpF8uMuAJO_M2pxb1Q9zNjWeS6o',
- ]);
- }
-
-
- //根据微信订单号退款
- public function refundByTransactionId()
- {
- $config = config('wechat.');
- $app = Factory::payment($config);
- $result = $app->refund->byTransactionId('transaction-id-xxx', 'refund-no-xxx', 10000, 10000, [
- // 可在此处传入其他参数,详细参数见微信支付文档
- 'refund_desc' => '商品已售完',
- ]);
- }
-
-
- //根据商户订单号退款
- public function refundByOutTradeNo()
- {
- $config = config('wechat.');
- $app = Factory::payment($config);
- $result = $app->refund->byOutTradeNumber('out-trade-no-xxx', 'refund-no-xxx', 20000, 1000, [
- // 可在此处传入其他参数,详细参数见微信支付文档
- 'refund_desc' => '退运费',
- ]);
- }
-
-
- //发送普通红包
- public function redPacket()
- {
- $config = config('wechat.');
- $app = Factory::payment($config);
- $redpack = $app->redpack;
- $redpackData = [
- 'mch_billno' => 'xy123456',
- 'send_name' => '测试红包',
- 're_openid' => 'oxTWIuGaIt6gTKsQRLau2M0yL16E',
- 'total_num' => 1, //固定为1,可不传
- 'total_amount' => 100, //单位为分,不小于100
- 'wishing' => '祝福语',
- 'client_ip' => '192.168.0.1', //可不传,不传则由 SDK 取当前客户端 IP
- 'act_name' => '测试活动',
- 'remark' => '测试备注',
- // ...
- ];
-
- $result = $redpack->sendNormal($redpackData);
- }
-}
\ No newline at end of file
diff --git a/application/admin/controller/WithdrawController.php b/application/admin/controller/WithdrawController.php
new file mode 100644
index 0000000..a588f21
--- /dev/null
+++ b/application/admin/controller/WithdrawController.php
@@ -0,0 +1,149 @@
+WITHDRAW_TYPE;
+ $STATUS_TYPE=$model->STATUS_TYPE;
+ $param = $request->param();
+
+ $where = [];
+ // 会员信息
+ if (!empty($param['search_key']) && !empty($param['keyword'])) {
+ $keyword = $param['keyword'];
+ if ($param['search_key'] == 'user_sn') {
+ $where[] = ['u.sn', '=', $keyword];
+ } elseif ($param['search_key'] == 'nickname'){
+ $where[] = ['u.nickname', 'like', '%' . $keyword . '%'];
+ }
+ }
+
+ //提现单号
+ if (isset($param['withdraw_sn']) && $param['withdraw_sn'] != '') {
+ $where[] = ['w.sn', '=', $param['withdraw_sn']];
+ }
+
+ //提现方式
+ if (isset($param['type']) && $param['type'] != '') {
+ $where[] = ['type', '=', $param['type']];
+ }
+
+ //提现状态
+ if (isset($param['status']) && $param['status'] != '') {
+ $where[] = ['w.status', '=', $param['status']];
+ }
+
+ // 提现时间
+ if (isset($param['start_time']) && $param['start_time'] && isset($param['end_time']) && $param['end_time']) {
+ $where[] = ['w.create_time', 'between', [strtotime($param['start_time']), strtotime($param['end_time'])]];
+ }
+
+ $model = $model
+ ->alias('w')
+ ->field('w.*,u.mobile,u.nickname,u.sn as user_sn,u.avatar')
+ ->join('user u', 'u.id = w.user_id')
+ ->where($where)
+ ->scope('where', $param);
+
+ $data = $model->paginate($this->admin['per_page'], false, ['query'=>$request->get()]);
+ //关键词,排序等赋值
+ $this->assign($request->get());
+
+ $this->assign([
+ 'data' => $data,
+ 'page' => $data->render(),
+ 'total' => $data->total(),
+ 'type_list' =>$WITHDRAW_TYPE,
+ 'status_list'=>$STATUS_TYPE,
+ ]);
+ return $this->fetch();
+ }
+
+ public function review($id,Request $request, WithdrawApply $model)
+ {
+ $this->assign([
+ 'id' => $id,
+ ]);
+ return $this->fetch();
+ }
+
+
+ //审核通过
+ public function confirm(Request $request, WithdrawApply $model)
+ {
+ $param = $request->param();
+ $id = $param['id'];
+ $withdraw =$model
+ ->where('id', $id)
+ ->find();
+ // 判断提现单是否为待提现状态 1
+ if($withdraw['status'] != 1) {
+ return error('不是待提现申请单');
+ }
+ // 启动事务
+ $model->startTrans();
+ try{
+ // 直接标识为审核成功状态
+ $model
+ ->where('id', $id)
+ ->update(['status' =>2, 'update_time' => time(),'description'=>$param['description']]);
+ // 提交事务
+ $model->commit();
+ }catch(\Exception $e){
+ // 回滚事务
+ $model->rollback();
+ return error($e->getMessage());
+ }
+ return success('审核通过');
+ }
+
+ //审核拒绝
+ public function refuse(Request $request, WithdrawApply $model)
+ {
+ $model->startTrans();
+ $param = $request->param();
+ try{
+ $withdraw_apply = WithdrawApply::where('id', $param['id'])->find();
+ $withdraw_apply->status =3; // 提现失败
+ $withdraw_apply->description = $param['description'];
+ $withdraw_apply->update_time = time();
+ $withdraw_apply->save();
+
+ //拒绝提现,回退佣金
+ $user = User::get($withdraw_apply['user_id']);
+ $user->integral = ['inc', $withdraw_apply['money']];
+ $user->save();
+
+ //增加账户变动记录
+ AccountLog::AccountRecord(
+ $withdraw_apply['user_id'],
+ $withdraw_apply['money'],
+ 1,
+ 130,
+ '',
+ $withdraw_apply['id'],
+ $withdraw_apply['sn']
+ );
+ $model->commit();
+ } catch (Exception $e){
+ $model->rollback();
+ return error($e->getMessage());
+ }
+ return success('提现失败已回退用户账户');
+ }
+}
diff --git a/application/admin/view/account_log/integrallist.html b/application/admin/view/account_log/integrallist.html
new file mode 100644
index 0000000..6a3bbae
--- /dev/null
+++ b/application/admin/view/account_log/integrallist.html
@@ -0,0 +1,174 @@
+{extend name="public/base" /}
+{block name='content'}
+{include file='public/content_header' /}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 流水单号(20位)
+ 会员昵称
+ 会员编号
+ 手机号码
+ 来源类型
+ 来源单号
+ 变动总数
+ 剩余总数
+ 变动时间
+
+
+
+ {foreach name="data" item="item"}
+
+ {$item.log_sn}
+ {$item.nickname}
+ {$item.user_sn}
+ {$item.mobile}
+ {$item.source_type_text}
+ {$item.source_sn}
+ {$item.change_amount}
+ {$item.left_amount}
+ {$item.create_time}
+
+ {/foreach}
+
+
+
+
+
+
+
+
+
+
+
+
+{/block}
+
diff --git a/application/admin/view/article/add.html b/application/admin/view/article/add.html
deleted file mode 100755
index d428a14..0000000
--- a/application/admin/view/article/add.html
+++ /dev/null
@@ -1,243 +0,0 @@
-{extend name='public/base' /}
-{block name='content'}
-{include file='public/content_header' /}
-
-
-{/block}
\ No newline at end of file
diff --git a/application/admin/view/article/index.html b/application/admin/view/article/index.html
deleted file mode 100755
index 8ef1d68..0000000
--- a/application/admin/view/article/index.html
+++ /dev/null
@@ -1,138 +0,0 @@
-{extend name="public/base" /}
-{block name='content'}
-{include file='public/content_header' /}
-
-
-
-{/block}
-
diff --git a/application/admin/view/article_category/add.html b/application/admin/view/article_category/add.html
deleted file mode 100755
index ea41639..0000000
--- a/application/admin/view/article_category/add.html
+++ /dev/null
@@ -1,100 +0,0 @@
-{extend name='public/base' /}
-{block name='content'}
-{include file='public/content_header' /}
-
-
-{/block}
\ No newline at end of file
diff --git a/application/admin/view/article_category/index.html b/application/admin/view/article_category/index.html
deleted file mode 100755
index 841c5aa..0000000
--- a/application/admin/view/article_category/index.html
+++ /dev/null
@@ -1,83 +0,0 @@
-{extend name="public/base" /}
-{block name='content'}
-{include file='public/content_header' /}
-
-
-
-{/block}
-
diff --git a/application/admin/view/brand/add.html b/application/admin/view/brand/add.html
deleted file mode 100755
index 75588e9..0000000
--- a/application/admin/view/brand/add.html
+++ /dev/null
@@ -1,95 +0,0 @@
-{extend name='public/base' /}
-{block name='content'}
-{include file='public/content_header' /}
-
-
-{/block}
\ No newline at end of file
diff --git a/application/admin/view/brand/index.html b/application/admin/view/brand/index.html
deleted file mode 100755
index 0846825..0000000
--- a/application/admin/view/brand/index.html
+++ /dev/null
@@ -1,131 +0,0 @@
-{extend name="public/base" /}
-{block name='content'}
-{include file='public/content_header' /}
-
-
-
-{/block}
-
diff --git a/application/admin/view/deliver_address/add.html b/application/admin/view/deliver_address/add.html
deleted file mode 100755
index ea673a9..0000000
--- a/application/admin/view/deliver_address/add.html
+++ /dev/null
@@ -1,282 +0,0 @@
-{extend name='public/base' /}
-{block name='content'}
-{include file='public/content_header' /}
-
-
-
-
-
-{/block}
\ No newline at end of file
diff --git a/application/admin/view/deliver_address/index.html b/application/admin/view/deliver_address/index.html
deleted file mode 100755
index 89d0544..0000000
--- a/application/admin/view/deliver_address/index.html
+++ /dev/null
@@ -1,138 +0,0 @@
-{extend name="public/base" /}
-{block name='content'}
-{include file='public/content_header' /}
-
-
-
-{/block}
-
diff --git a/application/admin/view/demo/email.html b/application/admin/view/demo/email.html
deleted file mode 100755
index 532a74a..0000000
--- a/application/admin/view/demo/email.html
+++ /dev/null
@@ -1,92 +0,0 @@
-
-{extend name="public/base" /}
-{block name='content'}
-{include file='public/content_header' /}
-
-
-
-
-{/block}
\ No newline at end of file
diff --git a/application/admin/view/demo/qr_code.html b/application/admin/view/demo/qr_code.html
deleted file mode 100755
index 1ebf2ec..0000000
--- a/application/admin/view/demo/qr_code.html
+++ /dev/null
@@ -1,164 +0,0 @@
-
-{extend name="public/base" /}
-{block name='content'}
-{include file='public/content_header' /}
-{js href="__ADMIN_PLUGINS__/jquery-qrcode/jquery-qrcode.min.js" /}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-{/block}
\ No newline at end of file
diff --git a/application/admin/view/demo/sms.html b/application/admin/view/demo/sms.html
deleted file mode 100755
index eb32154..0000000
--- a/application/admin/view/demo/sms.html
+++ /dev/null
@@ -1,70 +0,0 @@
-
-{extend name="public/base" /}
-{block name='content'}
-{include file='public/content_header' /}
-
-
-{/block}
\ No newline at end of file
diff --git a/application/admin/view/express/add.html b/application/admin/view/express/add.html
deleted file mode 100755
index 9b4ccf3..0000000
--- a/application/admin/view/express/add.html
+++ /dev/null
@@ -1,91 +0,0 @@
-{extend name='public/base' /}
-{block name='content'}
-{include file='public/content_header' /}
-
-
-{/block}
\ No newline at end of file
diff --git a/application/admin/view/express/index.html b/application/admin/view/express/index.html
deleted file mode 100755
index de8c38e..0000000
--- a/application/admin/view/express/index.html
+++ /dev/null
@@ -1,124 +0,0 @@
-{extend name="public/base" /}
-{block name='content'}
-{include file='public/content_header' /}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 查询
-
-
-
-
- 清空查询
-
-
-
-
-
-
-
-
-
-
-
-{/block}
-
diff --git a/application/admin/view/finance/lists.html b/application/admin/view/finance/lists.html
new file mode 100755
index 0000000..20276b0
--- /dev/null
+++ b/application/admin/view/finance/lists.html
@@ -0,0 +1,177 @@
+{extend name="public/base" /}
+{block name='content'}
+{include file='public/content_header' /}
+
+
+
+
+
+
+
+
+
+
本月订单金额(元)
+
+
+
1
+
+
+
+
+
订单总金额(元)
+
+
+
1
+
+
+
+
+
订单总数(笔)
+
+
+
1
+
+
+
+
+
退款订单总额(元)
+
+
+
1
+
+
+
+
+
退款订单总数(笔)
+
+
+
1
+
+
+
+
+
+
+
+
+
+
+
会员余额(元)
+
+
+
1
+
+
+
+
+
会员积分
+
+
+
1
+
+
+
+
+
会员可提现佣金(元)
+
+
+
1
+
+
+
+
+
会员已提现佣金(元)
+
+
+
1
+
+
+
+
+
+
+
+
+
+
+
+
本月分销佣金(元)
+
+
+
1
+
+
+
+
+
分销总佣金(元)
+
+
+
1
+
+
+
+
+
提现中佣金(元)
+
+
+
1
+
+
+
+
+
已提现佣金(元)
+
+
+
1
+
+
+
+
+
+
+
+{/block}
\ No newline at end of file
diff --git a/application/admin/view/goods/add.html b/application/admin/view/goods/add.html
index 21ca02d..87e6607 100755
--- a/application/admin/view/goods/add.html
+++ b/application/admin/view/goods/add.html
@@ -77,7 +77,6 @@ ul.albums li a.btn-fm_z{
@@ -227,6 +226,26 @@ ul.albums li a.btn-fm_z{
}
});
+
+
diff --git a/application/admin/view/goods/index.html b/application/admin/view/goods/index.html
index aa02a02..11e3b7f 100755
--- a/application/admin/view/goods/index.html
+++ b/application/admin/view/goods/index.html
@@ -93,18 +93,14 @@
placeholder="全选/取消">
ID
- 图片
名称
所属分类
- 品牌
- 原价
售价
- 重量(克)
+ 规格
库存
排序(升序)
是否上架
创建时间
-
操作
@@ -117,18 +113,14 @@
placeholder="选择/取消">
{$item.id}
-
{$item.name}
{$item.goods_category.name|default=''}
- {$item.brand.name|default=''}
- {$item.origin_price}
{$item.price}
- {$item.weight}
+ {$item.attr}
{$item.stock}
{$item.sort_number}
{$item.status_text}
{$item.create_time}
-
diff --git a/application/admin/view/goods_attr_category/add.html b/application/admin/view/goods_attr_category/add.html
deleted file mode 100755
index 6e960c6..0000000
--- a/application/admin/view/goods_attr_category/add.html
+++ /dev/null
@@ -1,170 +0,0 @@
-{extend name='public/base' /}
-{block name='content'}
-{include file='public/content_header' /}
-
-
-{/block}
\ No newline at end of file
diff --git a/application/admin/view/goods_attr_category/index.html b/application/admin/view/goods_attr_category/index.html
deleted file mode 100755
index 07b346d..0000000
--- a/application/admin/view/goods_attr_category/index.html
+++ /dev/null
@@ -1,118 +0,0 @@
-{extend name="public/base" /}
-{block name='content'}
-{include file='public/content_header' /}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 查询
-
-
-
-
- 清空查询
-
-
-
-
-
-
-
-
-
-
-
-{/block}
-
diff --git a/application/admin/view/index/index.html b/application/admin/view/index/index.html
index 26313d4..3cdaddb 100755
--- a/application/admin/view/index/index.html
+++ b/application/admin/view/index/index.html
@@ -1,252 +1,155 @@
{extend name="public/base" /}
{block name='content'}
{include file='public/content_header' /}
+
-
- {if $welcome_info}
-
-
-
-
你好,{$user.nickname|default='管理员'}:
- 欢迎来到{$admin.name|default='后台管理系统'},左侧为菜单区域,右侧为功能区。
-
+
+
+
- {/if}
-
-
-
-
-
-
-
-
-
-
后台用户
-
{$admin_user_count|default='0'}
+
+
+
+
+
+
{$res.order_num_today}
+
昨日:{$res.order_num_yesterday}
+ {$res.order_num_change}
+
+
成交订单总量(笔)
{$res.order_num_all}
+
-
-
-
-
-
-
-
-
后台角色
-
{$admin_role_count|default='0'}
+
+
+
+
+
{$res.order_amount_today}
+
+
昨日:{$res.order_amount_yesterday}
+ {$res.order_amount_change}
+
销售总额(元)
{$res.order_amount_all}
+
-
-
-
-
-
-
-
-
后台菜单
-
{$admin_menu_count|default='0'}
+
+
+
+
+
{$res.add_user_today}
+
昨日:{$res.add_user_yesterday}
+ {$res.add_user_change}
+
+
-
-
-
-
-
-
-
-
-
-
-
操作日志
-
{$admin_log_count|default='0'}
+
+
-
-
-
-
+
{/block}
\ No newline at end of file
diff --git a/application/admin/view/layout1.html b/application/admin/view/layout1.html
new file mode 100755
index 0000000..5eeea22
--- /dev/null
+++ b/application/admin/view/layout1.html
@@ -0,0 +1,29 @@
+{if !$admin.pjax}
+
+
+
+
+
+
+{/if}
+ {block name='title'}
+
{$admin.title|default='Admin'} | {$admin.name|default='Admin'}
+ {/block}
+{if !$admin.pjax}
+
+ {include file='public/head_css' /}
+ {include file='public/head_js' /}
+
+
+{/if}
+
+
+ {block name='content'}{/block}
+
+{if !$admin.pjax}
+{/if}
+
+{if !$admin.pjax}
+
+
+{/if}
\ No newline at end of file
diff --git a/application/admin/view/order/add.html b/application/admin/view/order/add.html
deleted file mode 100755
index 69d9037..0000000
--- a/application/admin/view/order/add.html
+++ /dev/null
@@ -1,349 +0,0 @@
-{extend name='public/base' /}
-{block name='content'}
-{include file='public/content_header' /}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-{/block}
\ No newline at end of file
diff --git a/application/admin/view/order/detail.html b/application/admin/view/order/detail.html
deleted file mode 100755
index d2f5011..0000000
--- a/application/admin/view/order/detail.html
+++ /dev/null
@@ -1,113 +0,0 @@
-
-{extend name="public/base" /}
-{block name='content'}
-{include file='public/content_header' /}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 基本信息
-
-
-
- 订单ID
- {$data.id}
- 订单号
- {$data.order_no}
- 订单金额
- {$data.order_price}
- 下单人
- {$data.user.nickname|default=''}[{$data.user.mobile|default=''}]
- 下单时间
- {$data.create_time}
-
-
-
- 支付信息
-
-
-
- 应付金额
- {$data.pay_price}
- 支付方式
- {$data.pay_channel_text}
- 实付金额
- {$data.pay_price}
- 支付状态
- {$data.pay_status_text}
- 付款时间
- {$data.pay_time}
-
-
-
-
- 商品信息
-
-
- 名称
- 价格
- 数量
- 小记
-
-
- {foreach name='data.orderGoods' item='item'}
-
- {$item.name}
- {$item.price}
- {$item.number}
- {$item.total_price}
-
- {/foreach}
-
-
- 收货信息
-
-
-
- 发货状态
- {$data.deliver_status_text}
- 收货人姓名
- {$data.name}
- 订收货人手机号
- {$data.mobile}
- 收货地址
- {$data.full_address}
- 快递单号
- {$data.express_no}[{$data.express.name|default=''}]
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-{/block}
\ No newline at end of file
diff --git a/application/admin/view/order/index.html b/application/admin/view/order/index.html
index f6768ec..5d0187f 100755
--- a/application/admin/view/order/index.html
+++ b/application/admin/view/order/index.html
@@ -1,90 +1,165 @@
{extend name="public/base" /}
{block name='content'}
{include file='public/content_header' /}
+
-
-
-
-
-
+
-
-
-
-
-
-
- ID
- 订单编号
- 下单用户
- 订单金额
- 收货人姓名
- 收货手机号
- 收货地址
- 支付渠道
- 支付状态
- 发货状态
- 下单时间
-
- 操作
-
+
+
+ 用户信息
+
+
+ 订单信息
+
+
+ 商品信息
+
+ 购买数量
+ 结束时间
+ 产生收益
+ 创建时间
+
{foreach name="data" item="item"}
- {$item.id}
- {$item.order_no}
- {$item.user.nickname|default=''}
- {$item.order_price}
- {$item.name}
- {$item.mobile}
- {$item.address}
- {$item.pay_channel_text}
- {$item.pay_status_text}
- {$item.deliver_status_text}
- {$item.create_time}
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {$item.number}
+
+
+ {$item.end_time}
+
+
+ {$item.profit}
+
+
+ {$item.create_time}
{/foreach}
@@ -115,6 +190,24 @@
+
{/block}
diff --git a/application/admin/view/public/head_js.html b/application/admin/view/public/head_js.html
index d90dabc..c03bb8e 100755
--- a/application/admin/view/public/head_js.html
+++ b/application/admin/view/public/head_js.html
@@ -24,6 +24,8 @@
{js href="__ADMIN_PLUGINS__/viewer/jquery-viewer.min.js" /}
{js href="__ADMIN_JS__/tag/jquery.tag-editor.js" /}
{css href="__ADMIN_JS__/tag/jquery.tag-editor.css" /}
+
+
diff --git a/application/admin/view/shop_config/fenxiao.html b/application/admin/view/shop_config/fenxiao.html
new file mode 100644
index 0000000..905250a
--- /dev/null
+++ b/application/admin/view/shop_config/fenxiao.html
@@ -0,0 +1,81 @@
+{extend name='public/base' /}
+{block name='content'}
+{include file='public/content_header' /}
+
+
+{/block}
\ No newline at end of file
diff --git a/application/admin/view/shop_config/goods.html b/application/admin/view/shop_config/goods.html
new file mode 100644
index 0000000..f239605
--- /dev/null
+++ b/application/admin/view/shop_config/goods.html
@@ -0,0 +1,114 @@
+{extend name='public/base' /}
+{block name='content'}
+{include file='public/content_header' /}
+
+
+{/block}
\ No newline at end of file
diff --git a/application/admin/view/shop_config/policy.html b/application/admin/view/shop_config/policy.html
new file mode 100644
index 0000000..ad4b6c0
--- /dev/null
+++ b/application/admin/view/shop_config/policy.html
@@ -0,0 +1,69 @@
+{extend name='public/base' /}
+{block name='content'}
+{include file='public/content_header' /}
+
+
+
+
+
+
+{/block}
\ No newline at end of file
diff --git a/application/admin/view/shop_config/shouyi.html b/application/admin/view/shop_config/shouyi.html
new file mode 100644
index 0000000..f3484c9
--- /dev/null
+++ b/application/admin/view/shop_config/shouyi.html
@@ -0,0 +1,102 @@
+{extend name='public/base' /}
+{block name='content'}
+{include file='public/content_header' /}
+
+
+
+{/block}
\ No newline at end of file
diff --git a/application/admin/view/shop_config/withdraw.html b/application/admin/view/shop_config/withdraw.html
new file mode 100644
index 0000000..bd2467b
--- /dev/null
+++ b/application/admin/view/shop_config/withdraw.html
@@ -0,0 +1,59 @@
+{extend name='public/base' /}
+{block name='content'}
+{include file='public/content_header' /}
+
+
+{/block}
\ No newline at end of file
diff --git a/application/admin/view/slide/add.html b/application/admin/view/slide/add.html
index bc5e7e3..d008cfa 100755
--- a/application/admin/view/slide/add.html
+++ b/application/admin/view/slide/add.html
@@ -1,6 +1,59 @@
{extend name='public/base' /}
{block name='content'}
{include file='public/content_header' /}
+