|
|
@@ -24,6 +24,7 @@ use app\common\model\file\File;
|
|
|
use app\common\model\financial\FinancialPaymentRecords;
|
|
|
use app\common\model\goods_category\GoodsCategory;
|
|
|
use app\common\model\user\User;
|
|
|
+use app\common\model\works\ServiceWorkAllocateWorkerLog;
|
|
|
use app\common\service\storage\Driver as StorageDriver;
|
|
|
use excel\ExcelWriter;
|
|
|
use Exception;
|
|
|
@@ -53,7 +54,7 @@ class ExcelExportService
|
|
|
$this->infoExport = $infoExport;
|
|
|
switch ($infoExport['download_type']){
|
|
|
case 1:
|
|
|
- case 2:
|
|
|
+ //case 2:
|
|
|
case 3:
|
|
|
if(!method_exists($this,$download_fun)){
|
|
|
throw new Exception('下载不存在-1001');
|
|
|
@@ -144,7 +145,7 @@ class ExcelExportService
|
|
|
/**
|
|
|
* @notes 工程师 -工单统计 导出
|
|
|
*/
|
|
|
- public function MasterWorkerServiceOrderDownload($infoExport)
|
|
|
+ /*public function MasterWorkerServiceOrderDownload($infoExport)
|
|
|
{
|
|
|
try{
|
|
|
$filename = $infoExport['name'];
|
|
|
@@ -181,7 +182,7 @@ class ExcelExportService
|
|
|
}
|
|
|
}
|
|
|
$lists = Db::name('master_worker')->alias('a')->field([
|
|
|
- 'a.id','a.real_name','a.nickname','a.worker_number','a.recruiting_behalf','a.mobile','a.cooperation','a.category_ids',
|
|
|
+ 'a.id','a.real_name','a.nickname','a.worker_number','a.recruiting_behalf','a.mobile','a.cooperation','a.category_ids','a.labels','a.remark',
|
|
|
Db::raw("COUNT(b.id) AS all_count"),
|
|
|
Db::raw("SUM(CASE WHEN b.service_status = 3 THEN 1 ELSE 0 END) AS success_count"),
|
|
|
Db::raw("SUM(CASE WHEN b.service_status = 4 OR b.service_status = 5 THEN 1 ELSE 0 END) AS fail_count"),
|
|
|
@@ -191,12 +192,19 @@ class ExcelExportService
|
|
|
->leftJoin('service_work b', 'a.id = b.master_worker_id'.$sqlJoin)
|
|
|
->where($where)
|
|
|
->group('a.id')
|
|
|
+ ->order('a.id desc')
|
|
|
->select()->toArray();
|
|
|
$categoryData = GoodsCategory::select()->toArray();
|
|
|
+// foreach ($lists as &$item) {
|
|
|
+// $item['category_name'] = $item['category_ids']?implode('、',array_column(get_parent_info($categoryData,explode(',',$item['category_ids'])),'name')):'';
|
|
|
+// }
|
|
|
foreach ($lists as &$item) {
|
|
|
+ $item['labels'] = $item['labels']?array_map(function ($item) { return intval($item); },explode(',',$item['labels'])):'';
|
|
|
$item['category_name'] = $item['category_ids']?implode('、',array_column(get_parent_info($categoryData,explode(',',$item['category_ids'])),'name')):'';
|
|
|
+ $item['allocate_num'] = ServiceWorkAllocateWorkerLog::where(['master_worker_id'=>$item['id']])->count();
|
|
|
}
|
|
|
|
|
|
+
|
|
|
$this->sheet->generateExcelFile([
|
|
|
'服务类别', '工程师编号', '工程师姓名', '工程师手机', '代招人姓名', '工程师接单数', '工程师成功单','工程师失败单','工程师成交金额','工程师提成金额'
|
|
|
], $lists,$filename.'-'.$infoExport->id, ['category_name','worker_number','real_name','mobile','recruiting_behalf','all_count','success_count','fail_count','work_total','worker_price']);
|
|
|
@@ -208,7 +216,7 @@ class ExcelExportService
|
|
|
}catch (\Exception $e){
|
|
|
throw new Exception($e->getMessage());
|
|
|
}
|
|
|
- }
|
|
|
+ }*/
|
|
|
|
|
|
// 权益卡编码导出
|
|
|
public function UserEquityDownload($infoExport){
|