Prechádzať zdrojové kódy

添加网格化接口

qiuzijian 1 rok pred
rodič
commit
1d125ee691
1 zmenil súbory, kde vykonal 4 pridanie a 5 odobranie
  1. 4 5
      Modules/Admin/Services/ApiService.php

+ 4 - 5
Modules/Admin/Services/ApiService.php

@@ -193,18 +193,17 @@ class ApiService{
         $data = [];
         $pie  = [];
         foreach ($query as $key => $val) {
+            $lastname = DB::connection('mysql_fwview')->table('hrmresource')
+                          ->where('id', $val->lrr)->value('lastname');
             $allcount = DB::connection('mysql_fwview')->table('formtable_main_974')
-                          ->where('szxmc', $depart)->count();
+                          ->where('szxmc', $val->xjdw)->count();
 
             $detail = DB::connection('mysql_fwview')->table('uf_wghgl_new')
-                        ->where('xjdw', $depart)
+                        ->where('xjdw', $val->xjdw)
                         ->where(DB::raw('DATE(lrsj)'), $val->lrdate)
                         ->where('lrr', $val->lrr)->count();
 
             if ($detail >= $allcount) {
-                $lastname = DB::connection('mysql_fwview')->table('hrmresource')
-                              ->where('id', $val->lrr)->value('lastname');
-
                 $data[$val->lrr] = [
                     'department' => $val->dwmc,
                     'lastname'   => $lastname,