|
@@ -147,4 +147,29 @@ class CollectInfo extends Controller
|
|
|
}
|
|
|
|
|
|
|
|
|
+ public function export_excl()
|
|
|
+ {
|
|
|
+ $list = Db::name('store_order_info')
|
|
|
+ ->alias('i')
|
|
|
+ ->field('count(i.id) num,i.name,i.uid,u.phone,u.name user_name')
|
|
|
+ ->join('store_member u','u.id = i.mid','left')
|
|
|
+ ->group('i.uid')
|
|
|
+ ->order('num desc')
|
|
|
+ ->order('num desc')->select();
|
|
|
+ $export = [];
|
|
|
+ foreach ($list as $value){
|
|
|
+ $export[] = [
|
|
|
+ $value['name'],
|
|
|
+ $value['user_name'],
|
|
|
+ $value['phone'],
|
|
|
+ $value['num'],
|
|
|
+ ];
|
|
|
+ }
|
|
|
+ PHPExcelService::setExcelHeader(['藏品名称','会员名称','电话','数量'])
|
|
|
+ ->setExcelTile('收藏统计导出' . date('YmdHis', time()), '收藏'. time(), ' 生成时间:' . date('Y-m-d H:i:s', time()))
|
|
|
+ ->setExcelContent($export)
|
|
|
+ ->ExcelSave();
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
}
|