hrjy 2 年之前
父节点
当前提交
dc629d5d55

+ 2 - 2
app/admin/controller/many/ManyOrder.php

@@ -60,9 +60,9 @@ class ManyOrder extends AuthController
             ['excel', 0],
             ['data', ''],
             ['many_id',''],
-            ['name', '']
+            ['name', ''],
+            ['type', '']
         ]);
-
         return Json::successlayui(\app\admin\model\many\ManyOrder::list($where));
     }
 

+ 1 - 1
app/admin/model/many/ManyOrder.php

@@ -50,8 +50,8 @@ class ManyOrder extends BaseModel
         if (trim($where['many_id']) != '')$model->where('b.id' , '=', $where['many_id']);
         if (trim($where['name']) != '')$model->where('u.uid|u.account|u.nickname' , 'like', '%'.$where['name'].'%');
         if (trim($where['data']) != '') $model = self::getModelTime($where, $model,  'a.create_time');
+        if ($where['type']) return $data = count($model->column('a.uid'));
         $data['count'] = $model->count();
-
         if (isset($where['excel']) && $where['excel'] == 1) {
             $list = ($list = $model->select()) && count($list) ? $list->toArray() : [];
         } else {

+ 6 - 0
app/admin/model/user/UserExtract.php

@@ -8,6 +8,8 @@
 
 namespace app\admin\model\user;
 
+use app\admin\model\many\ManyOrder;
+use app\admin\model\order\StoreOrder;
 use app\admin\model\wechat\WechatUser;
 use app\models\routine\RoutineTemplate;
 use think\facade\Route as Url;
@@ -56,6 +58,10 @@ class UserExtract extends BaseModel
         $data['priced'] = floatval(self::where('status', 1)->sum('extract_price'));
         //未提现金额
         $data['brokerage_not'] = bcsub(bcsub($data['brokerage_count'], $data['priced'], 2), $data['price'], 2);
+        //商品金额
+        $data['order_price'] = StoreOrder::where('paid', 1)->sum('pay_price');
+        //打怪金额
+        $data['many_price'] = ManyOrder::sum('price');
         return compact('data');
     }
 

+ 22 - 0
app/admin/view/finance/user_extract/index.php

@@ -56,6 +56,28 @@
                             </div>
                         </div>
                     </div>
+                    <div class="col-sm-3 ui-sortable">
+                        <div class="ibox float-e-margins">
+                            <div class="ibox-title">
+                                <span class="label label-danger pull-right">¥</span>
+                                <h5>购买商品总金额</h5>
+                            </div>
+                            <div class="ibox-content">
+                                <h1 class="no-margins">{$data.order_price}</h1>
+                            </div>
+                        </div>
+                    </div>
+                    <div class="col-sm-3 ui-sortable">
+                        <div class="ibox float-e-margins">
+                            <div class="ibox-title">
+                                <span class="label label-danger pull-right">¥</span>
+                                <h5>打怪使用金额</h5>
+                            </div>
+                            <div class="ibox-content">
+                                <h1 class="no-margins">{$data.many_price}</h1>
+                            </div>
+                        </div>
+                    </div>
                     <div class="col-sm-3 ui-sortable">
                         <div class="ibox float-e-margins">
                             <div class="ibox-title">

+ 23 - 3
app/admin/view/many/many_order/index.php

@@ -107,6 +107,17 @@
                                         </div>
                                     </div>
                                 </div>
+                                <div class="col-sm-3 ui-sortable">
+                                    <div class="ibox float-e-margins">
+                                        <div class="ibox-title">
+                                            <span class="label label-danger pull-right">人数</span>
+                                            <h5>投注人数</h5>
+                                        </div>
+                                        <div class="ibox-content">
+                                            <h1 class="no-margins">{{d.user}}</h1>
+                                        </div>
+                                    </div>
+                                </div>
                             </div>
                         </form>
                     </div>
@@ -127,8 +138,6 @@
                 <div class="layui-card-header">场次列表</div>
                 <div class="layui-card-body">
                     <table class="layui-hide" id="List" lay-filter="List"></table>
-
-
                     <script type="text/html" id="image">
                         <img style="cursor: pointer" lay-event="open_image" src="{{d.image}}">
                     </script>
@@ -176,11 +185,22 @@
             {field: 'create_time', title: '创建时间', align: 'center',width: '8%'},
             {field: 'right', title: '操作', align: 'center', toolbar: '#act',width: '15%'},
         ];
-    });
 
+    });
+    layList.baseGet(layList.U({a:'list',q:{type:1}}), function (res) {
+        console.log(res);
+    }, function (res) {
+        $('.no-margins').text(res.count);
+    });
     //查询
     layList.search('search',function(where){
         layList.reload(where,true);
+        console.log(where);
+        layList.baseGet(layList.U({c:'many.many_order',a:'list',q:{type:1,many_id:where['many_id'],name:where['name'],order_id:where['order_id'],stage:where['stage']}}), function (res) {
+            console.log(res);
+        }, function (res) {
+            $('.no-margins').text(res.count);
+        });
     });
 
     //点击事件绑定

+ 1 - 1
app/models/many/ManyOrder.php

@@ -46,7 +46,7 @@ class ManyOrder extends BaseModel
             ->leftJoin('user u', 'u.uid = a.uid')
             ->where('a.uid', $where['uid']);
 
-        if ($where['status'] == 0 or $where['status'])$model->where('a.status' , '=', $where['status']);
+//        if ($where['status'] == 0 or $where['status'])$model->where('a.status' , '=', $where['status']);
         $data['count'] = $model->count();
 
         if ($where['page'] && $where['limit']){

二进制
public/static/img/down.jpg