xieruidong 2 years ago
parent
commit
908c56c486

+ 6 - 0
application/admin/controller/Goods.php

@@ -224,4 +224,10 @@ class Goods extends Backend
             $this->success();
         }
     }
+
+    public function goods_statistics($ids){
+        $row=$this->model->find($ids);
+        $this->assign('row',$row);
+        return $this->fetch();
+    }
 }

+ 12 - 0
application/admin/view/goods/goods_statistics.html

@@ -0,0 +1,12 @@
+<form class="form-inline" role="form">
+    <div class="form-group">
+        <label for="time">时间段</label>
+        <input type="text" class="form-control datetimerange" id="time" placeholder="选择时间">
+    </div>
+    <div class="form-group" style="text-align: right">
+        <button type="submit" class="btn btn-primary">确定</button>
+    </div>
+</form>
+<table id="table" class="table table-bordered table-hover table-nowrap" width="100%">
+    <tr><td><b>商品名称</b></td><td>{$row.name}</td></tr>
+</table>

+ 18 - 0
public/assets/js/backend/goods.js

@@ -12,6 +12,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                     multi_url: 'goods/multi',
                     import_url: 'goods/import',
                     bind_url: 'goods/bind_goods',
+                    statistics_url: 'goods/goods_statistics',
                     table: 'goods',
                 }
             });
@@ -53,6 +54,20 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                                         return true;
                                     }
                                 },
+                                {
+                                    name: 'detail',
+                                    text: __('数据统计'),
+                                    title: __('数据统计'),
+                                    classname: 'btn btn-xs btn-info btn-dialog',
+                                    icon: 'fa',
+                                    url: extend.statistics_url,
+                                    extend:`data-area='["700px","80%"]'`,
+                                    callback: function (data) {
+                                    },
+                                    visible: function (row) {
+                                        return true;
+                                    }
+                                },
                             ]}
                     ]
                 ],
@@ -79,6 +94,9 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
             this.editor()
             Controller.api.bindevent();
         },
+        goods_statistics(){
+            Controller.api.bindevent();
+        },
         editor(){
             $('.btnAddSku').click(function (){
                 let a=$($('.skuItem')[0].outerHTML),key=Date.now()