提交 7ad03528 authored 作者: 窦斌's avatar 窦斌

edit

上级 7cc197f1
......@@ -327,9 +327,9 @@ class AdminService extends Service
if(!isset($request['page']) || $request['page']==1) {
$results = DB::table('wash_performance_work')
->leftjoin('work_order', 'work_order.wor_id', '=', 'wash_performance_work.pewo_wor_id')
// ->where('pewo_shop_id', $user_info->adm_shop_id)
// ->where('pewo_service_adm_id', $user_info->adm_id)
// ->where('pewo_create_time', 'like', $request['time']. '%')
->where('pewo_shop_id', $user_info->adm_shop_id)
->where('pewo_service_adm_id', $user_info->adm_id)
->where('pewo_create_time', 'like', $request['time']. '%')
->select('wor_service_standard', DB::raw('COUNT(DISTINCT pewo_wor_id) as count'))
->groupBy('wor_service_standard')
->get()
......@@ -518,6 +518,30 @@ class AdminService extends Service
->orderBy('adm_id', 'desc')
->get()->toArray();
foreach ($admin as $key => $value) {
$typecount = [];
$results = DB::table('wash_work_technician_part as wotp')
->leftJoin('work_order as w', 'w.wor_id', '=', 'wotp.wotp_wor_id')
->where('wotp_service_adm_id', $value->adm_id)
->where('wor_create_time', 'like', $now_year_month.'%')
->select('wor_service_standard', DB::raw('COUNT(DISTINCT wor_id) as count'))
->groupBy('wor_service_standard')
->get()
->mapWithKeys(function ($item) {
return [$item->wor_service_standard => $item->count];
})
->toArray();
if(!empty($results)){
$services = new PublicSearch();
$serviceStandard = $services->getServiceStandard(true);
$num = 0;
foreach($results as $k => $v){
$typecount[$num]['name'] = $serviceStandard[$k];
$typecount[$num]['value'] = $v;
$num++;
}
}
$admin[$key]->typecount = $typecount;
$work_order = DB::table('wash_work_technician_part as wotp')
->leftJoin('work_order as w', 'w.wor_id', '=', 'wotp.wotp_wor_id')
->where('wotp_service_adm_id', $value->adm_id)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论