diff --git a/README.md b/README.md index c2a217a..edea654 100755 --- a/README.md +++ b/README.md @@ -68,8 +68,15 @@ composer require yzalis/identicon composer require topthink/think-image php think UserStatisticsHour ``` +## +1. 接入微信小程序订单(需要订单页面,订单详情页面) +2. 修改前端支付页面,当抽数不够时,只显示对应的按钮。 +3. +SELECT goods_id,goods_title,goods_price,order_total,order_zhe_total,price,use_money,use_integral,use_money2,addtime,pay_time,prize_num,use_coupon FROM `order` where user_id=21544 and status=1 + +## 原抽无限赏奖逻辑(内存消耗过大,不在使用) ```sh // #组合中奖商品 diff --git a/app/admin/controller/Statistics.php b/app/admin/controller/Statistics.php index 0aff64a..d605d80 100755 --- a/app/admin/controller/Statistics.php +++ b/app/admin/controller/Statistics.php @@ -23,100 +23,93 @@ class Statistics extends Base public function profit(Request $request) { + $goodId = trim(input('get.goodId')); $title = trim(input('get.title')); - $id = trim(input('get.goodId')); $status = trim(input('get.status')); $type = trim(input('get.type')); $addtime = trim(input('get.addtime')); // 构建查询条件 - $whe = []; - if ($title) - $whe[] = ['title', 'like', '%' . $title . '%']; - if ($id) - $whe[] = ['id', '=', $id]; - if ($status) - $whe[] = ['status', '=', $status]; - if ($type) - $whe[] = ['type', '=', $type]; + $where = [['delete_time', '=', null]]; + if ($goodId) { + $where[] = ['id', '=', $goodId]; + } + if ($title) { + $where[] = ['title', 'like', '%' . $title . '%']; + } + if ($status) { + $where[] = ['status', '=', $status]; + } + if ($type) { + $where[] = ['type', '=', $type]; + } // 解析时间范围 - $whe3 = []; - $whe4 = []; + $startTime = 0; + $endTime = time(); if ($addtime) { - [$start_time, $end_time] = $this->parseTimeRange($addtime); - $whe3[] = ['addtime', 'BETWEEN', [$start_time, $end_time]]; - $whe4[] = ['addtime', 'BETWEEN', [$start_time, $end_time]]; + $times = explode(' - ', $addtime); + $startTime = strtotime($times[0]); + $endTime = strtotime($times[1]); } - // 获取商品ID列表 - $goodList = GoodsModel::where($whe)->column('id'); - if (empty($goodList)) { + // 获取测试用户ID + $testUsers = User::where('istest', '>', 0)->column('id'); + $testUserIds = empty($testUsers) ? [0] : $testUsers; + $testUserIdsStr = implode(',', $testUserIds); - View::assign([ + // 构建SQL查询 + $query = Db::name('goods')->alias('goods') + ->field([ + 'goods.id', + 'goods.title', + 'goods.imgurl', + 'goods.price', + 'goods.stock', + 'goods.status', + 'goods.type', + '(SELECT COALESCE(sum(use_money), 0) + COALESCE(sum(price), 0) FROM `order` WHERE status=1 AND (price>0 OR use_money>0) AND pay_time > ' . $startTime . ' and pay_time < ' . $endTime . ' AND goods_id=goods.id AND status=1 AND user_id NOT IN (' . $testUserIdsStr . ')) AS use_money', + '(SELECT COALESCE(sum(goodslist_money), 0) FROM `order_list` WHERE goods_id=goods.id AND user_id NOT IN (' . $testUserIdsStr . ') AND addtime > ' . $startTime . ' and addtime < ' . $endTime . ') AS sc_money', + '(SELECT COALESCE(sum(goodslist_money), 0) FROM `order_list` WHERE goods_id=goods.id AND LENGTH(recovery_num)>0 AND user_id NOT IN (' . $testUserIdsStr . ') AND addtime > ' . $startTime . ' and addtime < ' . $endTime . ') AS re_money', + '(SELECT COALESCE(sum(goodslist_money), 0) FROM `order_list` WHERE goods_id=goods.id AND LENGTH(send_num)>0 AND user_id NOT IN (' . $testUserIdsStr . ') AND addtime > ' . $startTime . ' and addtime < ' . $endTime . ') AS fh_money', + '(SELECT count(1) FROM `order_list` WHERE goods_id=goods.id AND user_id NOT IN (' . $testUserIdsStr . ') AND addtime > ' . $startTime . ' and addtime < ' . $endTime . ' and parent_goods_list_id=0 ) AS cj_count' + ]) + ->where($where) + ->order(['goods.id' => 'desc']); - 'sum_dingdan' => 0, - 'sum_shiji' => 0, - 'sum_chuhuo' => 0, - 'price_all' => 0, - 'sum_shijilirun' => 0, - 'sum_dingdanlirun' => 0, - 'use_money_all' => 0, - 'order_total_all' => 0, - 'list' => [], - 'count' => 0, - 'page' => '', - ]); - return View::fetch("Statistics/profit"); + // 获取列表数据 + $list = $query->select()->toArray(); + + // 计算总金额 + $totalIncome = 0; + $totalCost = 0; + $totalProfit = 0; + $totalReMoney = 0; + $totalFhMoney = 0; + + foreach ($list as &$item) { + // 计算单个盒子的利润和利润率 + $item['profit'] = $item['use_money'] - $item['sc_money']; + $item['profit_rate'] = $item['use_money'] > 0 ? round(($item['profit'] / $item['use_money']) * 100, 2) : 0; + $item['is_negative'] = $item['profit'] < 0; + + // 计算总金额 + $totalIncome += $item['use_money']; + $totalCost += $item['sc_money']; + $totalReMoney += $item['re_money']; + $totalFhMoney += $item['fh_money']; } - // 获取测试用户ID列表 - $userList = User::where('istest', '>', 0)->column('id'); - - // 订单筛选条件 - $whe3[] = ['user_id', 'not in', $userList]; - $whe3[] = ['status', '=', 1]; - $whe3[] = ['goods_id', 'in', $goodList]; - - $whe4[] = ['user_id', 'not in', $userList]; - $whe4[] = ['goods_id', 'in', $goodList]; - - // 统计订单数据 - $orderTotals = OrderModel::where($whe3) - ->field('SUM(order_total) as order_total_all, - SUM(order_zhe_total) as order_zhe_total_all, - SUM(price) as price_all, - SUM(use_money) as use_money_all') - ->find(); - - $goodslistMoneyAll = OrderList::where($whe4)->sum('goodslist_money'); - - // 获取商品列表 - $data = GoodsModel::getList($whe, "*", "id desc", 20); - - // 计算每个商品的订单详情 - foreach ($data['list'] as &$value) { - $value = array_merge($value, $this->calculateOrderDetails($value['id'], $userList, $addtime)); - } - - // 计算利润 - $sum_shijilirun = round($orderTotals->order_zhe_total_all - $goodslistMoneyAll, 2); - $sum_dingdanlirun = round($orderTotals->order_total_all - $goodslistMoneyAll, 2); + $totalProfit = $totalIncome - $totalCost; // 传递数据给视图 View::assign([ - - 'sum_dingdan' => $orderTotals->order_total_all, - 'sum_shiji' => $orderTotals->order_zhe_total_all, - 'sum_chuhuo' => $goodslistMoneyAll, - 'price_all' => $orderTotals->price_all, - 'sum_shijilirun' => $sum_shijilirun, - 'sum_dingdanlirun' => $sum_dingdanlirun, - 'use_money_all' => $orderTotals->use_money_all, - 'order_total_all' => $orderTotals->order_total_all, - 'list' => $data['list'], - 'count' => $data['count'], - 'page' => $data['page'], + 'list' => $list, + 'totalIncome' => $totalIncome, + 'totalCost' => $totalCost, + 'totalProfit' => $totalProfit, + 'totalReMoney' => $totalReMoney, + 'totalFhMoney' => $totalFhMoney, ]); return View::fetch("Statistics/profit"); @@ -413,5 +406,148 @@ class Statistics extends Base return View::fetch('Statistics/userstatistics'); } + /** + * 订单列表 + */ + public function orderList(Request $request) + { + $goodsId = $request->param('goods_id', 0, 'intval'); + + // 获取测试用户ID + $testUsers = User::where('istest', '>', 0)->column('id'); + + // 查询条件 + $where = [ + ['status', '=', 1], + ['goods_id', '=', $goodsId] + ]; + + if (!empty($testUsers)) { + $where[] = ['user_id', 'not in', $testUsers]; + } + + // 获取订单列表 + $list = OrderModel::where($where) + ->append(['user_info']) + ->order('id', 'desc') + ->paginate(['list_rows' => 50, 'query' => request()->param()]); + + // 传递数据给视图 + View::assign([ + 'list' => $list, + 'page' => $list->render(), + 'goods_id' => $goodsId + ]); + + return View::fetch("Statistics/orderList"); + } + + /** + * 出货列表 + */ + public function goodsList(Request $request) + { + $goodsId = $request->param('goods_id', 0, 'intval'); + + // 获取测试用户ID + $testUsers = User::where('istest', '>', 0)->column('id'); + + // 查询条件 + $where = [ + ['goods_id', '=', $goodsId] + ]; + + if (!empty($testUsers)) { + $where[] = ['user_id', 'not in', $testUsers]; + } + + // 获取出货列表 + $list = OrderList::where($where) + ->order('id', 'desc') + ->paginate(['list_rows' => 50, 'query' => request()->param()]); + + // 传递数据给视图 + View::assign([ + 'list' => $list, + 'page' => $list->render(), + 'goods_id' => $goodsId + ]); + + return View::fetch("Statistics/goodsList"); + } + + /** + * 兑换列表 + */ + public function exchangeList(Request $request) + { + $goodsId = $request->param('goods_id', 0, 'intval'); + + // 获取测试用户ID + $testUsers = User::where('istest', '>', 0)->column('id'); + + // 查询条件 + $where = [ + ['goods_id', '=', $goodsId] + ]; + + $where[] = ['recovery_num', '!=', '']; + // $where[] = ['recovery_num', '!=', null]; + + if (!empty($testUsers)) { + $where[] = ['user_id', 'not in', $testUsers]; + } + + // 获取兑换列表 + $list = OrderList::where($where) + ->order('id', 'desc') + ->paginate(['list_rows' => 50, 'query' => request()->param()]); + + // 传递数据给视图 + View::assign([ + 'list' => $list, + 'page' => $list->render(), + 'goods_id' => $goodsId + ]); + + return View::fetch("Statistics/exchangeList"); + } + + /** + * 发货列表 + */ + public function shipmentList(Request $request) + { + $goodsId = $request->param('goods_id', 0, 'intval'); + + // 获取测试用户ID + $testUsers = User::where('istest', '>', 0)->column('id'); + + // 查询条件 + $where = [ + ['goods_id', '=', $goodsId] + ]; + + $where[] = ['send_num', '<>', '']; + // $where[] = ['send_num', '<>', null]; + + if (!empty($testUsers)) { + $where[] = ['user_id', 'not in', $testUsers]; + } + + // 获取发货列表 + $list = OrderList::where($where) + ->order('id', 'desc') + ->paginate(['list_rows' => 50, 'query' => request()->param()]); + + // 传递数据给视图 + View::assign([ + 'list' => $list, + 'page' => $list->render(), + 'goods_id' => $goodsId + ]); + + return View::fetch("Statistics/shipmentList"); + } } diff --git a/app/admin/route/app.php b/app/admin/route/app.php index 48a7ece..54360bb 100755 --- a/app/admin/route/app.php +++ b/app/admin/route/app.php @@ -312,6 +312,14 @@ Route::rule('productcate_del', 'ProductCate/del', 'GET|POST'); Route::rule('statistics_profit', 'Statistics/profit', 'GET'); //数据看台 Route::rule('statistics_dataStand', 'Statistics/DataStand', 'GET'); +//兑换列表 +Route::rule('statistics_exchangeList', 'Statistics/exchangeList', 'GET'); +//发货列表 +Route::rule('statistics_shipmentList', 'Statistics/shipmentList', 'GET'); +//出货列表 +Route::rule('statistics_orderList', 'Statistics/goodsList', 'GET'); +//支付订单 +Route::rule('statistics_order', 'Statistics/orderList', 'GET'); //利润支出 Route::rule('ProfitExpenses', 'Profit/index', 'GET'); diff --git a/app/admin/view/Goods/goods_extend.html b/app/admin/view/Goods/goods_extend.html old mode 100644 new mode 100755 diff --git a/app/admin/view/Statistics/exchangeList.html b/app/admin/view/Statistics/exchangeList.html new file mode 100644 index 0000000..aefa6a9 --- /dev/null +++ b/app/admin/view/Statistics/exchangeList.html @@ -0,0 +1,73 @@ +{include file="Public:header2"/} + + +
+
+
兑换列表
+
+ + + + + + + + + + + + + + + + + + + + + {volist name="list" id="vo" key="i"} + + + + + + + + + + + + + + + + + {/volist} + {if condition="empty($list)"} + + + + {/if} + +
序号ID订单ID用户ID兑换单号盒子ID奖品ID奖品名称奖品图片奖品价值兑换价值奖品类型添加时间选择时间
{$i}{$vo.id}{$vo.order_id}{$vo.user_id}{$vo.recovery_num}{$vo.goods_id}{$vo.goodslist_id}{$vo.goodslist_title} + + ¥ {$vo.goodslist_price}¥ {$vo.goodslist_money} + {if condition="$vo.goodslist_type eq 1"} + 现货 + {elseif condition="$vo.goodslist_type eq 2"} + 预售 + {elseif condition="$vo.goodslist_type eq 3"} + 货币 + {elseif condition="$vo.goodslist_type eq 4"} + 宝箱 + {/if} + {$vo.addtime|date="Y-m-d H:i:s"}{$vo.choice_time|date="Y-m-d H:i:s"}
暂时没有数据!
+
+ {$page|raw} +
+
+
+
+ {include file="Public:footer"/} + + \ No newline at end of file diff --git a/app/admin/view/Statistics/goodsList.html b/app/admin/view/Statistics/goodsList.html new file mode 100644 index 0000000..b3a0ff1 --- /dev/null +++ b/app/admin/view/Statistics/goodsList.html @@ -0,0 +1,81 @@ +{include file="Public:header2"/} + + +
+
+
出货列表
+
+ + + + + + + + + + + + + + + + + + + + {volist name="list" id="vo"} + + + + + + + + + + + + + + + + {/volist} + {if condition="empty($list)"} + + + + {/if} + +
ID订单ID用户ID盒子ID盒子排序奖品ID奖品名称奖品图片奖品价值兑换价值奖品类型状态添加时间
{$vo.id}{$vo.order_id}{$vo.user_id}{$vo.goods_id}{$vo.num}{$vo.goodslist_id}{$vo.goodslist_title} + + ¥ {$vo.goodslist_price}¥ {$vo.goodslist_money} + {if condition="$vo.goodslist_type eq 1"} + 现货 + {elseif condition="$vo.goodslist_type eq 2"} + 预售 + {elseif condition="$vo.goodslist_type eq 3"} + 货币 + {elseif condition="$vo.goodslist_type eq 4"} + 宝箱 + {/if} + + {if condition="$vo.status eq 0"} + 待选择 + {elseif condition="$vo.status eq 1"} + 回收 + {elseif condition="$vo.status eq 2"} + 选择发货 + {elseif condition="$vo.status eq 3"} + 发布集市 + {/if} + {$vo.addtime|date="Y-m-d H:i:s"}
暂时没有数据!
+
+ {$page|raw} +
+
+
+
+ {include file="Public:footer"/} + + \ No newline at end of file diff --git a/app/admin/view/Statistics/orderList.html b/app/admin/view/Statistics/orderList.html new file mode 100644 index 0000000..f5034c6 --- /dev/null +++ b/app/admin/view/Statistics/orderList.html @@ -0,0 +1,73 @@ +{include file="Public:header2"/} + + +
+
+
支付订单列表
+
+ + + + + + + + + + + + + + + + + + + + + + + + {volist name="list" id="vo"} + + + + + + + + + + + + + + + + + + + + {/volist} + {if condition="empty($list)"} + + + + {/if} + +
序号订单ID订单号用户ID用户昵称盒子ID盒子名称订单总金额实际支付微信钻石UU币达达卷优惠券抵扣订单状态下单时间支付时间
{$i}{$vo.id}{$vo.order_num}{$vo.user_id}{$vo.user_info? $vo.user_info.nickname:$vo.user_id}{$vo.goods_id}{$vo.goods_title}¥ {$vo.order_total}¥ {$vo.order_zhe_total}¥ {$vo.price}¥ {$vo.use_money}¥ {$vo.use_coupon}¥ {$vo.use_integral}¥ {$vo.use_money2} + {if condition="$vo.status eq 1"} + 已支付 + {else} + 未支付 + {/if} + {$vo.addtime|date="Y-m-d H:i:s"}{$vo.pay_time|date="Y-m-d H:i:s"}
暂时没有数据!
+
+ {$page|raw} +
+
+
+
+ {include file="Public:footer"/} + + \ No newline at end of file diff --git a/app/admin/view/Statistics/profit.html b/app/admin/view/Statistics/profit.html index 8f5743d..5883bb4 100755 --- a/app/admin/view/Statistics/profit.html +++ b/app/admin/view/Statistics/profit.html @@ -1,9 +1,9 @@ -{include file="Public:header2"/} +{include file="Public:header3"/}
- +
@@ -32,8 +32,6 @@
@@ -45,186 +43,172 @@
-
+ +
-
- 订单收入:{$sum_dingdan} - 实际收入:{$sum_shiji} - 微信收入:{$price_all} - 余额收入:{$use_money_all} - - 出货价值:{$sum_chuhuo} - 订单利润:{if condition="$sum_dingdanlirun < 0"} - {$sum_dingdanlirun} - {elseif condition="$sum_dingdanlirun >= 0"} - {$sum_dingdanlirun} - {/if} - - 实际利润: - {if condition="$sum_shijilirun < 0"} {$sum_shijilirun} - {elseif condition="$sum_shijilirun >= 0"} - {$sum_shijilirun} - {/if} - - +
+
+
+
总收入
+
+ ¥ {$totalIncome|default="0"|round=2} +
+
+
+
+
+
总出货价值
+
+ ¥ {$totalCost|default="0"|round=2} +
+
+
+
+
+
总利润
+
+ ¥ {$totalProfit|default="0"|round=2} +
+
+
+
+
+
总兑换/发货价值
+
+ ¥ {$totalReMoney|default="0"|round=2} / + ¥ {$totalFhMoney|default="0"|round=2} +
+
+
+ + - - - - - + + + + + + + {volist name="list" id="vo"} - + + + - - - - - + + - - - - {/volist} - - {if condition="empty($list)"} + + + + + + {/volist} + {if condition="empty($list)"} - + {/if} -
盒子ID 盒子名称 盒子类型/状态盒子数据支付金额抵扣相关支付金额合计盒子单价抽奖次数收入 出货价值兑换价值发货价值 利润利润率操作
{$vo.id}{$vo.title} - {if condition="$vo['type'] eq 1"} -
- {$vo['id']} -
- {elseif condition="$vo['type'] eq 11"} -
- {$vo['id']} -
- - {else } - - {$vo['id']} - {/if} -
{$vo['title']} - {if condition="$vo['type'] eq 1"} - - {elseif condition="$vo['type'] eq 2"} - - {elseif condition="$vo['type'] eq 3"} - - {elseif condition="$vo['type'] eq 5"} - - {elseif condition="$vo['type'] eq 6"} - - {elseif condition="$vo['type'] eq 8"} - - {elseif condition="$vo['type'] eq 9"} - - {elseif condition="$vo['type'] eq 10"} - - {elseif condition="$vo['type'] eq 11"} - + {if condition="$vo.type eq 1"} + + {elseif condition="$vo.type eq 2"} + + {elseif condition="$vo.type eq 3"} + + {elseif condition="$vo.type eq 5"} + + {elseif condition="$vo.type eq 6"} + + {elseif condition="$vo.type eq 8"} + + {elseif condition="$vo.type eq 9"} + + {elseif condition="$vo.type eq 10"} + + {elseif condition="$vo.type eq 11"} + {/if} / - {if condition="$vo['status'] eq 1" } - 上架 - {elseif condition="$vo['status'] eq 2"} - 下架 - {elseif condition="$vo['status'] eq 3"} - 售罄 + {if condition="$vo.status eq 1"} + 上架 + {elseif condition="$vo.status eq 2"} + 下架 + {elseif condition="$vo.status eq 3"} + 售罄 {/if} 盒子单价:{$vo['price']}
- 订单数量:{$vo['order_count']}
- 抽奖次数:{$vo['count_OrderList']}
-
¥ {$vo.price}{$vo.cj_count} - 微信-支付金额:{$vo['count_price']}
- 钻石-支付金额: {$vo['count_yue']}
+ ¥ {$vo.use_money|default="0"|round=2}
- 积分抵扣: {$vo['count_use_score']}
- 优惠卷抵扣:{$vo['count_use_coupon']} + ¥ {$vo.sc_money|default="0"|round=2}
- 订单收入:{$vo['order_total']}
- 实际收入:{$vo['order_zhe_total']}(去除折扣)
- 收入核算1:{$vo['order_total']}(订单数量*价格)
- 收入核算2:{$vo['count_heji']}(微信+余额+各种抵扣)
- -
出货价值:{$vo['goodslist_price']}实际利润: - {if condition="$vo['lirun'] < 0"} {$vo['lirun']}
- 利润率: {$vo['lirulv']}%
- {elseif condition="$vo['lirun'] >= 0"} - {$vo['lirun']}
- 实际利润率: {$vo['lirulv']}%
- {/if} - - 订单利润: - {if condition="$vo['liruns'] < 0"} - {$vo['liruns']}
- 订单利润率: {$vo['lirulvs']}%
- {elseif condition="$vo['liruns'] >= 0"} - {$vo['liruns']}
- 订单利润率: {$vo['lirulvs']}%
- {/if} - - - - +
+ ¥ {$vo.re_money|default="0"|round=2} + ¥ {$vo.fh_money|default="0"|round=2} + + = 0"}layui-bg-green{else}layui-bg-red{/if}"> + ¥ {$vo.profit|default="0"|round=2} + + + = 0"}layui-bg-green{else}layui-bg-red{/if}"> + {$vo.profit_rate|default="0"|round=2}% + + + + + + +
暂时没有数据!暂时没有数据!
-
- {$page|raw} -
- {include file="Public:footer"/} + {include file="Public:footer3"/} - \ No newline at end of file diff --git a/app/admin/view/Statistics/shipmentList.html b/app/admin/view/Statistics/shipmentList.html new file mode 100644 index 0000000..d1faef6 --- /dev/null +++ b/app/admin/view/Statistics/shipmentList.html @@ -0,0 +1,79 @@ +{include file="Public:header"/} + + +
+
+
发货列表
+
+ + + + + + + + + + + + + + + + + + + + + {volist name="list" id="vo"} + + + + + + + + + + + + + + + + + {/volist} + {if condition="empty($list)"} + + + + {/if} + +
ID订单ID用户ID发货单号盒子ID奖品ID奖品名称奖品图片奖品价值兑换价值奖品类型保险状态添加时间选择时间
{$vo.id}{$vo.order_id}{$vo.user_id}{$vo.send_num}{$vo.goods_id}{$vo.goodslist_id}{$vo.goodslist_title} + + ¥ {$vo.goodslist_price}¥ {$vo.goodslist_money} + {if condition="$vo.goodslist_type eq 1"} + 现货 + {elseif condition="$vo.goodslist_type eq 2"} + 预售 + {elseif condition="$vo.goodslist_type eq 3"} + 货币 + {elseif condition="$vo.goodslist_type eq 4"} + 宝箱 + {/if} + + {if condition="$vo.insurance_is eq 0"} + + {elseif condition="$vo.insurance_is eq 1"} + + {/if} + {$vo.addtime|date="Y-m-d H:i:s"}{$vo.choice_time|date="Y-m-d H:i:s"}
暂时没有数据!
+
+ {$page|raw} +
+
+
+
+ {include file="Public:footer"/} + + \ No newline at end of file diff --git a/app/admin/view/Statistics/userstatistics.html b/app/admin/view/Statistics/userstatistics.html index 140d05e..797934d 100755 --- a/app/admin/view/Statistics/userstatistics.html +++ b/app/admin/view/Statistics/userstatistics.html @@ -193,7 +193,7 @@ trigger: 'axis' }, legend: { - data: ['登录', '注册', '消费人数', '微信充值人数'] + data: ['登录', '注册'] }, grid: { left: '3%', @@ -241,18 +241,18 @@ data: registerData // 使用生成的时间序列数据 }, - { - name: '消费人数', - type: 'line', + // { + // name: '消费人数', + // type: 'line', - data: consumeData // 使用生成的时间序列数据 - }, - { - name: '微信充值人数', - type: 'line', - stack: 'Total', - data: consume_rmb_count // 使用生成的时间序列数据 - } + // data: consumeData // 使用生成的时间序列数据 + // }, + // { + // name: '微信充值人数', + // type: 'line', + // stack: 'Total', + // data: consume_rmb_count // 使用生成的时间序列数据 + // } ] }; @@ -269,7 +269,7 @@ trigger: 'axis' }, legend: { - data: ['总消费', '微信充值', '余额充值'] + data: ['总消费', '微信消费', '钻石消费'] }, grid: { left: '3%', @@ -312,13 +312,13 @@ data: recharge_sum // 使用生成的时间序列数据 }, { - name: '微信充值', + name: '微信消费', type: 'line', data: recharge_amount // 使用生成的时间序列数据 }, { - name: '余额充值', + name: '钻石消费', type: 'line', data: balance_consume // 使用生成的时间序列数据 @@ -338,7 +338,7 @@ trigger: 'axis' }, legend: { - data: ['利润', '总收入', '总支出'] + data: ['总收入', '总支出'] }, grid: { left: '3%', @@ -374,12 +374,12 @@ } ], series: [ - { - name: '利润', - type: 'line', + // { + // name: '利润', + // type: 'line', - data: all_money // 使用生成的时间序列数据 - }, + // data: all_money // 使用生成的时间序列数据 + // }, { name: '总收入', type: 'line', @@ -395,8 +395,8 @@ ] }; // 使用刚指定的配置项和数据显示图表 - var lirun = echarts.init(document.getElementById('lirun')); - lirun.setOption(option2); + // var lirun = echarts.init(document.getElementById('lirun')); + // lirun.setOption(option2); // 指定图表的配置项和数据 var option3 = { @@ -464,8 +464,8 @@ ] }; // 使用刚指定的配置项和数据显示图表 - var qita = echarts.init(document.getElementById('qita')); - qita.setOption(option3); + // var qita = echarts.init(document.getElementById('qita')); + // qita.setOption(option3); diff --git a/app/api/controller/FuLiWu.php b/app/api/controller/FuLiWu.php index 773a813..a9d3af5 100755 --- a/app/api/controller/FuLiWu.php +++ b/app/api/controller/FuLiWu.php @@ -316,7 +316,7 @@ class FuLiWu extends Base public function fuliwu_user_winning_records(Request $request) { $user = $this->getUser(); - $user_id = $user['user_id']; + $user_id = $user['id']; $list = OrderList::where('user_id', '=', $user_id) ->where('order_type', '=', 15) diff --git a/app/api/controller/Goods.php b/app/api/controller/Goods.php index 98ddce1..312cbf5 100755 --- a/app/api/controller/Goods.php +++ b/app/api/controller/Goods.php @@ -287,8 +287,8 @@ class Goods extends Base #概率 if ($surplus_stock > 0) { $pro_basics = bcdiv("$surplus_stock", "$all_surplus_stock", 4); - $pro = '概率:' . ($pro_basics * 100) . '%'; - $pro_num = ($pro_basics * 100); + $pro = '概率:' . removeTrailingZeros(($pro_basics * 100)) . '%'; + $pro_num = removeTrailingZeros(($pro_basics * 100)); } else { $pro = '概率:' . 0 . '%'; $pro_num = 0; @@ -441,8 +441,8 @@ class Goods extends Base } if ($value_1['stock'] == 0) { //保留两位小数 - $value_1['pro'] = '概率:' . round($value_1['real_pro'], 2) . '%'; - $value_1['pro_num'] = round($value_1['real_pro'], 2); + $value_1['pro'] = '概率:' . removeTrailingZeros(round($value_1['real_pro'], 2)) . '%'; + $value_1['pro_num'] = removeTrailingZeros(round($value_1['real_pro'], 2)); unset($value_1['surplus_stock']); unset($value_1['stock']); continue; @@ -459,7 +459,7 @@ class Goods extends Base #概率 if ($surplus_stock_1 > 0) { //计算概率,保留两位小数 - $pro_num_1 = round(($surplus_stock_1 / $goodsList_surplus_stock) * 100, 2); + $pro_num_1 = removeTrailingZeros(round(($surplus_stock_1 / $goodsList_surplus_stock) * 100, 2) ); $pro_1 = '概率:' . $pro_num_1 . '%'; } else { $pro_1 = '概率:' . 0 . '%'; diff --git a/app/api/controller/Login.php b/app/api/controller/Login.php index 4b492d8..10723e0 100755 --- a/app/api/controller/Login.php +++ b/app/api/controller/Login.php @@ -567,7 +567,7 @@ class Login extends Base public function ip_location($last_login_ip) { if ($last_login_ip) { - $url = "https://restapi.amap.com/v3/ip?key=6a46ad822120e393956e89d498e8c40b&ip=" . "$last_login_ip" . ""; + $url = "https://restapi.amap.com/v3/ip?key=2bf9bdfeb03a8835ce324443eb18e4da&ip=" . "$last_login_ip" . ""; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); @@ -682,35 +682,7 @@ class Login extends Base $data = $wxServer->getAccessTokenOffiaccountSign($url); return $this->renderSuccess('', $data); } - public function test() - { - $account_token['token'] = "77f6358084be8d5545747911e7f9d5ad5644a114"; - $account_token['logintype'] = "2"; - return $this->renderSuccess("登录成功", $account_token); - } - - public function test1() - { - $share_image = getConfig("base")['share_image']; - $public_path = dirname($_SERVER['SCRIPT_FILENAME']); - $poster_bg = $public_path . $share_image; - // var_dump($poster_bg); - // $rule = getConfig('base'); - // $draw_people_num = $rule['draw_people_num']; - // $user_id = 31; - // $pid = 24; - // if(!empty($pid)){ - // $num = 0; - // $num = ProfitDraw::where(['type'=>5,'user_id'=>$pid])->count(); - // if(bccomp("$num","$draw_people_num") < 0){ - // #可以获得一张抽奖券 - // $res= User::changeDraw($pid, 1,5 , '获得一张抽奖券',$user_id); - // var_dump($res); - // } - - // } - // log::info($res); - } + /** @@ -762,7 +734,7 @@ class Login extends Base ); // //将数据写入redis,过期时间为当天剩余的时间 // $redis->set($redis_key, json_encode($user), 86400 - time() % 86400); - return $this->renderSuccess('登录记录成功', [ + return $this->renderSuccess('登录成功', [ 'uid' => $user['uid'] ?: $user['id'], 'nickname' => $user['nickname'], 'headimg' => imageUrl($user['headimg']) diff --git a/app/api/controller/Notify.php b/app/api/controller/Notify.php index b30ad5c..ba41413 100755 --- a/app/api/controller/Notify.php +++ b/app/api/controller/Notify.php @@ -1156,18 +1156,18 @@ class Notify extends Base $currentRange = 0; foreach ($goodslist as $good) { - if ($good['stock'] <= 0) { - continue; - } + // if ($good['stock'] <= 0) { + // continue; + // } #判断今日库存 $user_quanju_count = OrderList::field('id') ->where('goods_id', '=', $goods_id) ->where('parent_goods_list_id', '=', 0) ->where('addtime', '>=', $todayMidnight) ->count(); - if ($user_quanju_count >= $good['stock']) { - continue; - } + // if ($user_quanju_count >= $good['stock']) { + // continue; + // } $rangeStart = $currentRange; $currentRange += $good['real_pro']; $probabilityRanges[] = [ @@ -1203,7 +1203,10 @@ class Notify extends Base ->order('id desc') ->value('luck_no'); $luck_no++; - + $doubling = $prize_info['doubling']; + if(!$doubling){ + $doubling=0; + } #新增记录 $save_prize_info = [ 'order_id' => $order_id, @@ -1211,7 +1214,7 @@ class Notify extends Base 'status' => 0,#0未操作 1选择兑换 2选择发货 'goods_id' => $goods_id, 'num' => 0, - 'doubling' => $prize_info['doubling'], + 'doubling' => $doubling, 'shang_id' => $prize_info['shang_id'], 'goodslist_id' => $prize_info['id'], 'goodslist_title' => $prize_info['title'], @@ -1359,7 +1362,10 @@ class Notify extends Base ->order('id desc') ->value('luck_no'); $luck_no++; - + $doubling =$prize_info['doubling']; + if(!$doubling){ + $doubling=0; + } #新增记录 $save_prize_info = [ 'order_id' => $order_id, @@ -1367,7 +1373,7 @@ class Notify extends Base 'status' => 0,#0未操作 1选择兑换 2选择发货 'goods_id' => $goods_id, 'num' => 0, - 'doubling' => $prize_info['doubling'], + 'doubling' => $doubling, 'shang_id' => $prize_info['shang_id'], 'goodslist_id' => $prize_info['id'], 'goodslist_title' => $prize_info['title'], @@ -1574,7 +1580,7 @@ class Notify extends Base Db::name('goods_king_rank')->where([['user_id', '=', $infinite_goods['king_user_id']], ['goods_id', '=', $v['goods_id']]])->order('id', 'desc')->limit(1)->inc('z_nums', 1)->update(); $king_money = $infinite_goods['lingzhu_fan']; if ($king_money && $king_money > 0) { - + Db::name('goods_king_rank')->where([['user_id', '=', $infinite_goods['king_user_id']], ['goods_id', '=', $v['goods_id']]])->order('id', 'desc')->limit(1)->inc('money', floatval($king_money))->update(); // User::changeIntegral($infinite_goods['king_user_id'], $king_money, 4, '领主收益'); diff --git a/app/api/controller/Order.php b/app/api/controller/Order.php new file mode 100644 index 0000000..a873686 --- /dev/null +++ b/app/api/controller/Order.php @@ -0,0 +1,134 @@ +getUser(); + + // 获取分页参数 + $page = $this->request->param('page', 1); + $pageSize = $this->request->param('page_size', 10); + + // 获取订单列表 + $orderQuery = Db::name('order') + ->field('goods_id, goods_title, goods_price, order_total, order_zhe_total, price, use_money, use_integral, use_money2, addtime, pay_time, prize_num, use_coupon, order_num') + ->where([ + 'user_id' => $user['id'], + 'status' => 1 + ]) + ->order('addtime desc'); + + // 获取总数 + $total = $orderQuery->count(); + + // 获取分页数据 + $orderList = $orderQuery->page($page, $pageSize)->select()->toArray(); + + // 格式化数据 + foreach ($orderList as &$order) { + // 格式化时间 + $order['addtime'] = date('Y-m-d H:i:s', $order['addtime']); + $order['pay_time'] = $order['pay_time'] ? date('Y-m-d H:i:s', $order['pay_time']) : ''; + // 格式化价格数据 + $order['goods_price'] = (float)$order['goods_price']; + $order['order_total'] = (float)$order['order_total']; + $order['order_zhe_total'] = (float)$order['order_zhe_total']; + $order['price'] = (float)$order['price']; + $order['use_money'] = (float)$order['use_money']; + $order['use_money2'] = (float)$order['use_money2']; + } + unset($order); + + // 返回分页数据 + $data = [ + 'list' => $orderList, + 'total' => $total, + 'page' => (int)$page, + 'page_size' => (int)$pageSize, + 'total_pages' => ceil($total / $pageSize) + ]; + + return $this->renderSuccess('获取成功', $data); + } + + /** + * 获取订单详情 + * + * @return \think\Response + */ + public function getOrderDetail() + { + // 获取订单编号 + $orderNum = $this->request->param('order_num', ''); + if (empty($orderNum)) { + return $this->renderError('订单编号不能为空'); + + } + + // 获取当前登录用户 + $user = $this->getUser(); + + // 获取订单详情 + $orderInfo = Db::name('order') + ->field('goods_id, goods_title, goods_price, id, order_total, order_zhe_total, price, use_money, use_integral, use_money2, addtime, pay_time, prize_num, use_coupon') + ->where([ + 'status' => 1, + 'order_num' => $orderNum + ]) + ->find(); + + if (!$orderInfo) { + return $this->renderError('订单不存在'); + + } + + // 格式化时间 + $orderInfo['addtime'] = date('Y-m-d H:i:s', $orderInfo['addtime']); + $orderInfo['pay_time'] = $orderInfo['pay_time'] ? date('Y-m-d H:i:s', $orderInfo['pay_time']) : ''; + + // 格式化价格数据 + $orderInfo['goods_price'] = (float)$orderInfo['goods_price']; + $orderInfo['order_total'] = (float)$orderInfo['order_total']; + $orderInfo['order_zhe_total'] = (float)$orderInfo['order_zhe_total']; + $orderInfo['price'] = (float)$orderInfo['price']; + $orderInfo['use_money'] = (float)$orderInfo['use_money']; + $orderInfo['use_money2'] = (float)$orderInfo['use_money2']; + + // 获取订单商品列表 + $orderGoods = Db::name('order_list') + ->field('goodslist_title, goodslist_imgurl, goodslist_price, addtime') + ->where([ + 'order_id' => $orderInfo['id'] + ]) + ->select()->toArray(); + + // 格式化订单商品数据 + foreach ($orderGoods as &$goods) { + $goods['addtime'] = date('Y-m-d H:i:s', $goods['addtime']); + $goods['goodslist_price'] = (float)$goods['goodslist_price']; + $goods['goodslist_imgurl'] = imageUrl($goods['goodslist_imgurl']); + } + unset($goods); + + $orderInfo['goods_list'] = $orderGoods; + + return $this->renderSuccess('获取成功', $orderInfo); + } + +} \ No newline at end of file diff --git a/app/api/controller/Pay.php b/app/api/controller/Pay.php index 5b90f6b..d1977fe 100755 --- a/app/api/controller/Pay.php +++ b/app/api/controller/Pay.php @@ -179,7 +179,7 @@ class Pay extends Base return $this->wxpay($order_num, $total, $title, $openid, $notify); } elseif ($type == 4) { //积分 商城购买 - $order = ProductOrder::getInfo(['order_num' => $order_num]); + $order = OrderModel::getInfo(['order_num' => $order_num]); $total = $order['total_money']; $notify = 'https://' . $_SERVER['HTTP_HOST'] . '/api/notify/order_notify4'; return $this->wxpay($order_num, $total, $title, $openid, $notify); diff --git a/app/api/route/app.php b/app/api/route/app.php index 3a656f9..5692383 100755 --- a/app/api/route/app.php +++ b/app/api/route/app.php @@ -199,4 +199,10 @@ Route::rule('login_record', 'Login/recordLogin', 'GET|POST'); Route::any('advlist', 'Index/getAdvert'); Route::any('recordConsume', 'Index/record'); Route::any('getPeopleList', 'Index/get_user_yaoqing'); -Route::any('getRankList', 'Index/getRankList'); \ No newline at end of file +Route::any('getRankList', 'Index/getRankList'); + +#============================ +#Order.php订单管理 +#============================ +Route::any('order_list', 'Order/getOrderList'); +Route::any('order_detail', 'Order/getOrderDetail'); \ No newline at end of file diff --git a/app/command/AutoGoodsOffshelf.php b/app/command/AutoGoodsOffshelf.php index 97797bc..bf0114d 100755 --- a/app/command/AutoGoodsOffshelf.php +++ b/app/command/AutoGoodsOffshelf.php @@ -8,6 +8,9 @@ use think\console\Input; use think\console\Output; use think\facade\Db; +/** + * 自动下架利润率过低的盒子 + */ class AutoGoodsOffshelf extends Command { protected function configure() diff --git a/app/command/FlwOpen.php b/app/command/FlwOpen.php index a74b871..46fa0b7 100755 --- a/app/command/FlwOpen.php +++ b/app/command/FlwOpen.php @@ -73,6 +73,7 @@ class FlwOpen extends Command protected function special_prize_notice_time($goods_id, $goods_title) { + echo ('福利屋开奖$goods_id' . $goods_id . '福利屋开奖$goods_title' . $goods_title) . PHP_EOL; $res = []; $num = 0; #第几箱 print_r('$goods_id' . $goods_id); @@ -101,6 +102,8 @@ class FlwOpen extends Command ->toArray(); // 如果没有参与用户,直接返回 if (empty($all_order_list)) { + + echo ('福利屋开奖完成没有用户参加, goods_id: ' . $goods_id) . PHP_EOL; Goods::where(['id' => $goods_id])->update(['is_open' => 1, 'status' => 3]); return $res; } @@ -187,10 +190,10 @@ class FlwOpen extends Command // 更新福利屋状态为已开奖 echo ('福利屋开奖完成 goods_id: ' . $goods_id) . PHP_EOL; - Log::info('福利屋开奖完成 goods_id: ' . $goods_id. PHP_EOL) ; + Log::info('福利屋开奖完成 goods_id: ' . $goods_id . PHP_EOL); } else { echo ('福利屋开奖未完成 goods_id: ' . $goods_id . ', 未处理用户数: ' . $unprocessed_count) . PHP_EOL; - Log::info('福利屋开奖未完成 goods_id: ' . $goods_id . ', 未处理用户数: ' . $unprocessed_count) ; + Log::info('福利屋开奖未完成 goods_id: ' . $goods_id . ', 未处理用户数: ' . $unprocessed_count); } return $res; diff --git a/app/command/RankMonth.php b/app/command/RankMonth.php index c2a75f8..b756fb1 100755 --- a/app/command/RankMonth.php +++ b/app/command/RankMonth.php @@ -13,7 +13,9 @@ use think\console\input\Option; use think\console\Output; use think\facade\Db; - +/** + * 月榜定榜 + */ class RankMonth extends Command { protected function configure() diff --git a/app/command/RankWeek.php b/app/command/RankWeek.php index 9fab7e6..49d4594 100755 --- a/app/command/RankWeek.php +++ b/app/command/RankWeek.php @@ -14,6 +14,9 @@ use think\console\Output; use think\facade\Db; +/** + * 周榜定榜 + */ class RankWeek extends Command { protected function configure() diff --git a/app/command/UserStatisticsDay.php b/app/command/UserStatisticsDay.php index 3c569fe..bf6bf32 100755 --- a/app/command/UserStatisticsDay.php +++ b/app/command/UserStatisticsDay.php @@ -16,12 +16,17 @@ use app\common\model\OrderList; use app\common\model\OrderListRecovery; use app\common\model\ProfitExpenses; use app\common\model\ProfitRvenue; +use app\common\model\UserLoginLog; + class UserStatisticsDay extends Command { // php think UserStatisticsDay + /** + * 用户每天数据统计 + */ protected function configure() { - $this->setName('UserStatisticsHour')->setDescription('用户每天数据统计'); + $this->setName('UserStatisticsDay')->setDescription('用户每天数据统计'); } protected function execute(Input $input, Output $output) @@ -42,9 +47,12 @@ class UserStatisticsDay extends Command $today_start = strtotime($today); $today_end = strtotime($today . ' +1 day'); - // 查询当天的登录人数 - $loginCount = UserAccount::where('last_login_time', '>=', $today_start) - ->where('last_login_time', '<', $today_end) + // // 查询当天的登录人数 + // $loginCount = UserAccount::where('last_login_time', '>=', $today_start) + // ->where('last_login_time', '<', $today_end) + // ->count('DISTINCT user_id'); + $loginCount = UserLoginLog::where('login_time','>=',$today_start) + ->where('login_time','<',$today_end) ->count('DISTINCT user_id'); //当天注册人数 $registerCount = User::where('addtime', '>=', $today_start) @@ -86,12 +94,13 @@ class UserStatisticsDay extends Command )->sum('use_money'); //今日消费 - $order_zhe_total = OrderModel::where('status', '=', 1)->whereNotIn('user_id', $userNotArray) - ->whereBetweenTime( - 'addtime', - $today_start, - $today_end - )->sum('order_zhe_total'); + $order_zhe_total= $order_today_price+$money_today; + // $order_zhe_total = OrderModel::where('status', '=', 1)->whereNotIn('user_id', $userNotArray) + // ->whereBetweenTime( + // 'addtime', + // $today_start, + // $today_end + // )->sum('order_zhe_total'); //今日消费 $consume_order_count = OrderModel::where('status', '=', 1)->whereNotIn('user_id', $userNotArray) ->whereBetweenTime( diff --git a/app/common.php b/app/common.php index c8c9329..eeb6e89 100755 --- a/app/common.php +++ b/app/common.php @@ -281,10 +281,10 @@ if (!function_exists('create_order_no')) { // 在MH_后面添加商户前缀,而不是替换MH_ $pre = 'MH_' . $merchant_prefix; } - + // 获取当前域名的微信小程序配置 $miniprogramConfig = \app\common\helper\MiniprogramHelper::getMiniprogramConfig(); - + // 如果小程序配置存在且有订单前缀,则添加到订单号中 if (!empty($miniprogramConfig) && !empty($miniprogramConfig['order_prefix'])) { // 在现有前缀后面添加小程序订单前缀 @@ -788,4 +788,14 @@ function getData($url, $header) curl_close($ch); return $handles; +} +if (!function_exists('removeTrailingZeros')) { + function removeTrailingZeros($numStr) + { + if (strpos($numStr, '.') !== false) { + $numStr = rtrim($numStr, '0'); // 移除右侧的零 + $numStr = rtrim($numStr, '.'); // 处理小数点后全零的情况 + } + return $numStr; + } } \ No newline at end of file diff --git a/app/common/model/UserLoginLog.php b/app/common/model/UserLoginLog.php index b097e73..5590360 100755 --- a/app/common/model/UserLoginLog.php +++ b/app/common/model/UserLoginLog.php @@ -42,7 +42,7 @@ class UserLoginLog extends Model // 如果今天已记录,则不再记录 if ($exist) { - return true; + return false; } // 添加登录记录 diff --git a/config/menu.php b/config/menu.php index da5f2fb..ce479ae 100755 --- a/config/menu.php +++ b/config/menu.php @@ -16,10 +16,10 @@ return [ 'url' => '/admin/record', 'name' => '流水排行', ], - [ - 'url' => '/admin/vip', - 'name' => 'VIP管理', - ], + // [ + // 'url' => '/admin/vip', + // 'name' => 'VIP管理', + // ], [ 'url' => '/admin/user_invite', 'name' => '用户邀请列表', @@ -99,10 +99,10 @@ return [ 'url' => '/admin/ProfitRvenue', 'name' => '其它收入', ], - [ - 'url' => '/admin/user_statistics', - 'name' => '数据统计', - ], + // [ + // 'url' => '/admin/user_statistics', + // 'name' => '数据统计', + // ], ], ], [ diff --git a/public/storage/poster/share/21549.png b/public/storage/poster/share/21549.png new file mode 100644 index 0000000..930d4fc Binary files /dev/null and b/public/storage/poster/share/21549.png differ diff --git a/table.sql b/table.sql index 83bdc7a..38e2f6a 100755 --- a/table.sql +++ b/table.sql @@ -56,7 +56,7 @@ CREATE TABLE `admin_goods_log` ( `ip` varchar(50) COLLATE utf8_unicode_ci NOT NULL COMMENT '登录ip', `addtime` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '登录时间', PRIMARY KEY (`id`) USING BTREE -) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ROW_FORMAT=DYNAMIC COMMENT='管理员登录日志'; +) ENGINE=InnoDB AUTO_INCREMENT=39 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ROW_FORMAT=DYNAMIC COMMENT='管理员登录日志'; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -72,7 +72,7 @@ CREATE TABLE `admin_login_log` ( `ip` varchar(50) COLLATE utf8_unicode_ci NOT NULL COMMENT '登录ip', `addtime` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '登录时间', PRIMARY KEY (`id`) USING BTREE -) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ROW_FORMAT=DYNAMIC COMMENT='管理员登录日志'; +) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ROW_FORMAT=DYNAMIC COMMENT='管理员登录日志'; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -90,7 +90,7 @@ CREATE TABLE `admin_operation_log` ( `content` text COLLATE utf8_unicode_ci, `addtime` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '操作时间', PRIMARY KEY (`id`) USING BTREE -) ENGINE=InnoDB AUTO_INCREMENT=973 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ROW_FORMAT=DYNAMIC COMMENT='管理员操作日志'; +) ENGINE=InnoDB AUTO_INCREMENT=2789 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ROW_FORMAT=DYNAMIC COMMENT='管理员操作日志'; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -238,7 +238,7 @@ CREATE TABLE `collect` ( `type` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '1一番赏 2无限赏 3擂台赏 4抽卡机 5积分赏 6全局赏 7福利盲盒 8领主赏 9连击赏', `addtime` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE -) ENGINE=MyISAM AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ROW_FORMAT=FIXED; +) ENGINE=MyISAM AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ROW_FORMAT=FIXED; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -300,7 +300,7 @@ CREATE TABLE `coupon_receive` ( `ttype` int(2) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) USING BTREE, UNIQUE KEY `id` (`id`) USING BTREE -) ENGINE=InnoDB AUTO_INCREMENT=26 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='用户优惠券表'; +) ENGINE=InnoDB AUTO_INCREMENT=46 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='用户优惠券表'; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -441,7 +441,7 @@ CREATE TABLE `goods` ( UNIQUE KEY `id` (`id`) USING BTREE, KEY `status` (`status`) USING BTREE, KEY `type` (`type`) USING BTREE -) ENGINE=InnoDB AUTO_INCREMENT=1013 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='盒子'; +) ENGINE=InnoDB AUTO_INCREMENT=1046 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='盒子'; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -461,7 +461,7 @@ CREATE TABLE `goods_extend` ( `pay_coupon` tinyint(1) NOT NULL DEFAULT '1' COMMENT '优惠券支付', `is_deduction` tinyint(1) NOT NULL DEFAULT '1' COMMENT '是否抵扣 1:抵扣 0:支付', PRIMARY KEY (`id`) USING BTREE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='盒子扩展表'; +) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='盒子扩展表'; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -533,7 +533,7 @@ CREATE TABLE `goods_list` ( KEY `surplus_stock` (`surplus_stock`) USING BTREE, KEY `prize_code` (`prize_code`) USING BTREE, KEY `card_no` (`card_no`) USING BTREE -) ENGINE=InnoDB AUTO_INCREMENT=134 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC COMMENT='盒子奖品'; +) ENGINE=InnoDB AUTO_INCREMENT=533 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC COMMENT='盒子奖品'; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -928,9 +928,9 @@ CREATE TABLE `order` ( `order_total` decimal(10,2) unsigned NOT NULL COMMENT '订单总金额', `order_zhe_total` decimal(10,2) unsigned NOT NULL COMMENT '订单折扣金额', `price` decimal(10,2) unsigned NOT NULL COMMENT '微信支付', - `use_money` decimal(10,2) unsigned NOT NULL COMMENT '余额抵扣', - `use_integral` decimal(10,2) unsigned NOT NULL COMMENT '潮币抵扣', - `use_score` decimal(10,2) unsigned NOT NULL COMMENT '积分抵扣', + `use_money` decimal(10,2) unsigned NOT NULL COMMENT '钻石支付', + `use_integral` decimal(10,2) unsigned NOT NULL COMMENT 'UU币支付', + `use_score` decimal(10,2) unsigned NOT NULL COMMENT '积分抵扣,未使用', `use_draw` int(11) DEFAULT '0' COMMENT '抽奖券抵扣', `use_item_card` int(11) DEFAULT '0' COMMENT '道具卡抵扣 (使用的数量)', `zhe` decimal(10,2) unsigned NOT NULL COMMENT '折扣', @@ -945,7 +945,7 @@ CREATE TABLE `order` ( `addtime` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '下单时间', `pay_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '付款时间', `pay_type` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '1微信 2支付宝', - `order_type` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '1一番赏 2无限赏 3擂台赏 4抽卡机 5积分赏 6全局赏 7福利盲盒 8领主赏 9连击赏', + `order_type` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '盒子类型', `kd_is` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '1卡单', `coupon_id` int(11) DEFAULT '0' COMMENT '优惠券id', `use_coupon` decimal(10,2) DEFAULT '0.00' COMMENT '优惠券抵扣', @@ -956,7 +956,7 @@ CREATE TABLE `order` ( `click_id` int(11) DEFAULT NULL, `is_flw` int(1) NOT NULL DEFAULT '0' COMMENT '是否为福利屋', `zdfh_time` int(10) DEFAULT '0' COMMENT '自动发货时间', - `use_money2` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '货币2抵扣金额', + `use_money2` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '达达卷支付', PRIMARY KEY (`id`) USING BTREE, UNIQUE KEY `id` (`id`) USING BTREE, UNIQUE KEY `order_num` (`order_num`) USING BTREE, @@ -964,7 +964,7 @@ CREATE TABLE `order` ( KEY `goods_id` (`goods_id`) USING BTREE, KEY `num` (`num`) USING BTREE, KEY `status` (`status`) USING BTREE -) ENGINE=InnoDB AUTO_INCREMENT=87 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='订单表'; +) ENGINE=InnoDB AUTO_INCREMENT=246 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='订单表'; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -989,12 +989,12 @@ CREATE TABLE `order_list` ( `goodslist_imgurl` varchar(255) DEFAULT NULL COMMENT '奖品封面图', `goodslist_price` decimal(10,2) unsigned NOT NULL COMMENT '奖品价值', `goodslist_money` decimal(10,2) unsigned NOT NULL COMMENT '奖品回收', - `goodslist_type` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '1现货 2预售', + `goodslist_type` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '1现货 2预售,3货币,4 宝箱', `goodslist_sale_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '预售时间', `addtime` int(10) unsigned NOT NULL COMMENT '创建时间', `choice_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '选择发货/回收时间', `insurance_is` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '保险柜0否 1是', - `order_type` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '1一番赏 2无限赏 3擂台赏 4抽卡机 5积分赏 6全局赏 7福利盲盒 8领主赏 9连击赏 10权益领取', + `order_type` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '盒子类型', `order_list_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '特殊奖品中奖订单id', `luck_no` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '抽奖序号', `prize_code` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '奖品code', @@ -1020,7 +1020,7 @@ CREATE TABLE `order_list` ( KEY `goodslist_type` (`goodslist_type`) USING BTREE, KEY `shang_id` (`shang_id`) USING BTREE, KEY `goodslist_id` (`goodslist_id`) USING BTREE -) ENGINE=InnoDB AUTO_INCREMENT=558 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='订单明细'; +) ENGINE=InnoDB AUTO_INCREMENT=2259 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='订单明细'; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -1041,7 +1041,7 @@ CREATE TABLE `order_list_recovery` ( UNIQUE KEY `id` (`id`) USING BTREE, UNIQUE KEY `recovery_num` (`recovery_num`) USING BTREE, KEY `user_id` (`user_id`) USING BTREE -) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='打包记录'; +) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='打包记录'; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -1097,7 +1097,7 @@ CREATE TABLE `picture` ( `status` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '1 正常 2 删除', `type` tinyint(1) DEFAULT NULL COMMENT '存储位置 1=本地 2= 阿里云', PRIMARY KEY (`id`) USING BTREE -) ENGINE=InnoDB AUTO_INCREMENT=40 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ROW_FORMAT=DYNAMIC; +) ENGINE=InnoDB AUTO_INCREMENT=221 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -1162,7 +1162,7 @@ CREATE TABLE `profit_integral` ( PRIMARY KEY (`id`) USING BTREE, UNIQUE KEY `id` (`id`) USING BTREE, KEY `user_id` (`user_id`) USING BTREE -) ENGINE=InnoDB AUTO_INCREMENT=20 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='财务明细'; +) ENGINE=InnoDB AUTO_INCREMENT=36 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='财务明细'; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -1185,7 +1185,7 @@ CREATE TABLE `profit_money` ( PRIMARY KEY (`id`) USING BTREE, UNIQUE KEY `id` (`id`) USING BTREE, KEY `user_id` (`user_id`) USING BTREE -) ENGINE=InnoDB AUTO_INCREMENT=73 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='财务明细'; +) ENGINE=InnoDB AUTO_INCREMENT=217 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='财务明细'; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -1208,7 +1208,7 @@ CREATE TABLE `profit_money2` ( PRIMARY KEY (`id`) USING BTREE, UNIQUE KEY `id` (`id`) USING BTREE, KEY `user_id` (`user_id`) USING BTREE -) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='财务明细'; +) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='财务明细'; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -1230,7 +1230,7 @@ CREATE TABLE `profit_ou_qi` ( PRIMARY KEY (`id`) USING BTREE, UNIQUE KEY `id` (`id`) USING BTREE, KEY `user_id` (`user_id`) USING BTREE -) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='欧气值明细'; +) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='欧气值明细'; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -1410,7 +1410,7 @@ CREATE TABLE `reward` ( `update_time` int(11) DEFAULT NULL, `reward_id` varchar(64) NOT NULL COMMENT '关联表id', PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=151 DEFAULT CHARSET=utf8mb4 COMMENT='奖励表'; +) ENGINE=InnoDB AUTO_INCREMENT=152 DEFAULT CHARSET=utf8mb4 COMMENT='奖励表'; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -1517,7 +1517,7 @@ CREATE TABLE `user` ( `uid` varchar(16) NOT NULL COMMENT '唯一编号', PRIMARY KEY (`id`) USING BTREE, UNIQUE KEY `id` (`id`) USING BTREE -) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC; +) ENGINE=InnoDB AUTO_INCREMENT=21547 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -1541,7 +1541,7 @@ CREATE TABLE `user_account` ( `ip_city` varchar(50) DEFAULT NULL, PRIMARY KEY (`id`) USING BTREE, UNIQUE KEY `id` (`id`) USING BTREE -) ENGINE=MyISAM AUTO_INCREMENT=8 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC; +) ENGINE=MyISAM AUTO_INCREMENT=18 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -1662,7 +1662,7 @@ CREATE TABLE `user_login_log` ( KEY `idx_date` (`login_date`) USING BTREE, KEY `idx_year_month` (`year`,`month`) USING BTREE, KEY `idx_year_week` (`year`,`week`) USING BTREE -) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='用户登录记录表'; +) ENGINE=InnoDB AUTO_INCREMENT=27 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='用户登录记录表'; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -1759,7 +1759,7 @@ CREATE TABLE `user_sign` ( `update_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间', `sign_type` tinyint(2) NOT NULL DEFAULT '0' COMMENT '月签到还是累计签到', PRIMARY KEY (`id`) USING BTREE -) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='用户签到表'; +) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='用户签到表'; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -1791,7 +1791,7 @@ CREATE TABLE `user_statistics` ( `all_recycle_money` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '总收入', `all_money` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '总利润', PRIMARY KEY (`id`) USING BTREE -) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='用户统计表'; +) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='用户统计表'; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -1814,7 +1814,7 @@ CREATE TABLE `user_task_list` ( `updatetime` int(11) NOT NULL, `deltime` int(11) DEFAULT NULL, PRIMARY KEY (`id`) USING BTREE -) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='用户完成任务记录表'; +) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='用户完成任务记录表'; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -1899,7 +1899,7 @@ CREATE TABLE `wxpay_log` ( `addtime` int(14) unsigned DEFAULT NULL, PRIMARY KEY (`id`) USING BTREE, UNIQUE KEY `order_no` (`order_no`) USING BTREE -) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='微信/支付宝支付信息'; +) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='微信/支付宝支付信息'; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -1936,4 +1936,4 @@ CREATE TABLE `yushou` ( /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2025-04-09 22:54:10 +-- Dump completed on 2025-04-10 22:23:48