hrjy há 2 anos atrás
pai
commit
fa4663ca30

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

@@ -50,7 +50,11 @@ 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'));
+        if ($where['type']){
+            $data['user'] = count($model->column('a.uid'));
+            $data['price'] = $model->sum('price');
+            return $data;
+        }
         $data['count'] = $model->count();
         if (isset($where['excel']) && $where['excel'] == 1) {
             $list = ($list = $model->select()) && count($list) ? $list->toArray() : [];

+ 16 - 4
app/admin/view/many/many_order/index.php

@@ -114,7 +114,18 @@
                                             <h5>投注人数</h5>
                                         </div>
                                         <div class="ibox-content">
-                                            <h1 class="no-margins">{{d.user}}</h1>
+                                            <h1 class="no-margins" id="user_count"></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" id="user_price"></h1>
                                         </div>
                                     </div>
                                 </div>
@@ -191,7 +202,8 @@
     layList.baseGet(layList.U({a:'list',q:{type:1}}), function (res) {
         console.log(res);
     }, function (res) {
-        $('.no-margins').text(res.count);
+        $('#user_count').text(res.count.user);
+        $('#user_price').text(res.count.price);
     });
     //查询
     layList.search('search',function(where){
@@ -200,7 +212,8 @@
         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);
+            $('#user_count').text(res.count.user);
+            $('#user_price').text(res.count.price);
         });
     });
 
@@ -303,7 +316,6 @@
             },
             methods: {
                 setData: function (item) {
-                    var that = this;
                     if (item.is_zd == true) {
                         that.showtime = true;
                         this.where.data = this.$refs.date_time.innerText;