diff --git a/README.md b/README.md index d65a9d2..d7f941e 100755 --- a/README.md +++ b/README.md @@ -61,4 +61,7 @@ putenv composer install php think run -composer require phpoffice/phpspreadsheet \ No newline at end of file +composer require phpoffice/phpspreadsheet + +php think UserStatisticsHour + diff --git a/app/admin/controller/Statistics.php b/app/admin/controller/Statistics.php index ca52b4d..ae4db18 100644 --- a/app/admin/controller/Statistics.php +++ b/app/admin/controller/Statistics.php @@ -4,6 +4,7 @@ namespace app\admin\controller; use app\common\model\Order as OrderModel; use app\common\model\OrderList; use app\common\model\OrderListRecovery; +use app\common\model\UserStatistics; use app\common\model\User; use app\admin\controller\Base; use app\common\model\Category; @@ -16,7 +17,7 @@ use think\facade\Db; use app\common\model\Shang; use app\common\model\ProfitExpenses; use app\common\model\ProfitRvenue; - + class Statistics extends Base { @@ -89,7 +90,7 @@ class Statistics extends Base // 传递数据给视图 View::assign([ - + 'sum_dingdan' => $orderTotals->order_total_all, 'sum_shiji' => $orderTotals->order_zhe_total_all, 'sum_chuhuo' => $goodslistMoneyAll, @@ -163,31 +164,31 @@ class Statistics extends Base // 计算利润 $lirun = round($orderStats->order_zhe_total - $goodslistMoney, 2); $liruns = round(($orderStats->count_price + $orderStats->count_yue + $orderStats->use_integral + $orderStats->use_score + $orderStats->use_coupon) - $goodslistMoney, 2); - + return [ 'order_count' => round($orderStats->count, 2), - 'count_price' =>round($orderStats->count_price, 2), - 'order_total' =>round( $orderStats->order_total, 2), + 'count_price' => round($orderStats->count_price, 2), + 'order_total' => round($orderStats->order_total, 2), 'count_yue' => round($orderStats->count_yue, 2), 'count_use_integral' => round($orderStats->use_integral, 2), 'count_use_score' => round($orderStats->use_score, 2), 'count_use_coupon' => round($orderStats->use_coupon, 2), 'count_heji' => round($orderStats->count_price + $orderStats->count_yue + $orderStats->use_integral + $orderStats->use_score + $orderStats->use_coupon, 2), - 'order_zhe_total'=>round($orderStats->order_zhe_total, 2), + 'order_zhe_total' => round($orderStats->order_zhe_total, 2), // 订单列表数量 'count_OrderList' => OrderList::where($whe2)->count(), // ✅ 添加这一行 - + // 订单总价验证 // 'count_heji_yanzheng' => $count_OrderList * $value['price'], // ✅ 使用 count_OrderList - + 'goodslist_price' => round($goodslistMoney, 2), 'lirun' => $lirun, 'liruns' => $liruns, 'lirulv' => $goodslistMoney == 0 ? 0 : round(($lirun / $goodslistMoney) * 100, 2), 'lirulvs' => $goodslistMoney == 0 ? 0 : round(($liruns / $goodslistMoney) * 100, 2), ]; - - + + } @@ -384,4 +385,13 @@ class Statistics extends Base } + public function UserStatistics() + { + + $list = UserStatistics::order('id desc')->limit(30)->select(); + View::assign('list', $list); + return View::fetch('Statistics/userstatistics'); + } + + } diff --git a/app/admin/controller/Upload.php b/app/admin/controller/Upload.php index c5cc270..dedcb45 100755 --- a/app/admin/controller/Upload.php +++ b/app/admin/controller/Upload.php @@ -169,6 +169,12 @@ class Upload extends Base } } + public function uploadimage(){ + + // return + + return '{"imageActionName":"uploadimage","imageFieldName":"upfile","imageMaxSize":51200000,"imageAllowFiles":[".png",".jpg",".jpeg",".gif",".bmp",".php"],"imageCompressEnable":true,"imageCompressBorder":600,"imageInsertAlign":"none","imageUrlPrefix":"","imagePathFormat":"\/ueditor\/php\/upload\/image\/{yyyy}{mm}{dd}\/{time}{rand:6}","scrawlActionName":"uploadscrawl","scrawlFieldName":"upfile","scrawlPathFormat":"\/ueditor\/php\/upload\/image\/{yyyy}{mm}{dd}\/{time}{rand:6}","scrawlMaxSize":51200000,"scrawlUrlPrefix":"","scrawlInsertAlign":"none","snapscreenActionName":"uploadimage","snapscreenPathFormat":"\/ueditor\/php\/upload\/image\/{yyyy}{mm}{dd}\/{time}{rand:6}","snapscreenUrlPrefix":"","snapscreenInsertAlign":"none","catcherLocalDomain":["127.0.0.1","localhost","img.baidu.com"],"catcherActionName":"catchimage","catcherFieldName":"source","catcherPathFormat":"\/ueditor\/php\/upload\/image\/{yyyy}{mm}{dd}\/{time}{rand:6}","catcherUrlPrefix":"","catcherMaxSize":51200000,"catcherAllowFiles":[".png",".jpg",".jpeg",".gif",".bmp"],"videoActionName":"uploadvideo","videoFieldName":"upfile","videoPathFormat":"\/ueditor\/php\/upload\/video\/{yyyy}{mm}{dd}\/{time}{rand:6}","videoUrlPrefix":"","videoMaxSize":102400000,"videoAllowFiles":[".flv",".swf",".mkv",".avi",".rm",".rmvb",".mpeg",".mpg",".ogg",".ogv",".mov",".wmv",".mp4",".webm",".mp3",".php",".wav",".mid"],"fileActionName":"uploadfile","fileFieldName":"upfile","filePathFormat":"\/ueditor\/php\/upload\/file\/{yyyy}{mm}{dd}\/{time}{rand:6}","fileUrlPrefix":"","fileMaxSize":51200000,"fileAllowFiles":[".png",".jpg",".jpeg",".gif",".bmp",".flv",".swf",".mkv",".avi",".rm",".rmvb",".mpeg",".mpg",".ogg",".ogv",".mov",".wmv",".mp4",".webm",".mp3",".wav",".mid",".rar",".zip",".tar",".gz",".7z",".bz2",".cab",".php",".iso",".doc",".docx",".xls",".xlsx",".ppt",".pptx",".pdf",".txt",".md",".xml"],"imageManagerActionName":"listimage","imageManagerListPath":"\/ueditor\/php\/upload\/image\/","imageManagerListSize":20,"imageManagerUrlPrefix":"","imageManagerInsertAlign":"none","imageManagerAllowFiles":[".png",".jpg",".jpeg",".gif",".php",".bmp"],"fileManagerActionName":"listfile","fileManagerListPath":"\/ueditor\/php\/upload\/file\/","fileManagerUrlPrefix":"","fileManagerListSize":20,"fileManagerAllowFiles":[".png",".jpg",".jpeg",".gif",".bmp",".flv",".swf",".mkv",".avi",".rm",".rmvb",".mpeg",".php",".mpg",".ogg",".ogv",".mov",".wmv",".mp4",".webm",".mp3",".wav",".mid",".rar",".zip",".tar",".gz",".7z",".bz2",".cab",".iso",".doc",".docx",".xls",".xlsx",".ppt",".pptx",".pdf",".txt",".md",".xml"]}'; + } /** * 阿里云oss上传 diff --git a/app/admin/route/app.php b/app/admin/route/app.php index e3d14f6..f49914e 100755 --- a/app/admin/route/app.php +++ b/app/admin/route/app.php @@ -288,3 +288,8 @@ Route::rule('rvenue_del', 'Profit/rvenue_del', 'POST'); Route::rule('user_invite', 'user/user_invite', 'GET'); +Route::rule('user_statistics', 'Statistics/UserStatistics', 'GET'); + + + +Route::rule('ueditor_uploadimage', 'Upload/uploadimage', 'GET|POST'); diff --git a/app/admin/view/Danye/edit.html b/app/admin/view/Danye/edit.html index 3dc6cd1..3b2b575 100755 --- a/app/admin/view/Danye/edit.html +++ b/app/admin/view/Danye/edit.html @@ -1,66 +1,81 @@ {include file="Public:header2"/} +
-