liuhairui il y a 2 semaines
Parent
commit
fa5734cda6

+ 1 - 2
application/api/controller/Product.php

@@ -458,8 +458,7 @@ class Product extends Api
 
         $params = Request::instance()->param();
 
-        // 接收参数
-        $sys_id = $params['sys_id'] ?? '超级管理员';
+        $sys_id = $params['sys_id'];
         $process_list = $params['process_list'] ?? [];
 
         if (empty($process_list)) {

+ 19 - 7
application/api/controller/ReportingWork.php

@@ -41,16 +41,28 @@ class ReportingWork extends Api
             $this->error('设备信息');
         }
         //小组信息
-        $person = db('人员_小组资料')
-            ->where('team_name', $majorprocess['设备编组'])
-            ->where('status', 1)
-            ->field('team_name as 小组名称,staff_no as 员工编号,staff_name as 员工姓名')
+//        $person = db('人员_小组资料')
+//            ->where('team_name', $majorprocess['设备编组'])
+//            ->where('status', 1)
+//            ->field('team_name as 小组名称,staff_no as 员工编号,staff_name as 员工姓名')
+//            ->select();
+        $person = Db::name('人员_小组资料')->alias('a')
+            ->field('
+                b.staff_no as 员工编号,
+                b.staff_name as 员工姓名,
+                a.team_name as 小组名称
+            ')
+            ->join('人员_基本资料 b', 'a.staff_no = b.staff_no')
+            ->where('a.team_name', $majorprocess['设备编组'])
+            ->whereNull('a.mod_rq')
+            ->whereNull('b.mod_rq')
+            ->order('a.id asc')
             ->select();
         if (empty($person)) {
             $this->error('未找到人员信息');
         }
         $data['majorprocess'] = $majorprocess;
-        $data['person'] = $person;  
+        $data['person'] = $person;
         $this->success('成功', $data);
     }
 
@@ -64,7 +76,7 @@ class ReportingWork extends Api
      * @throws \think\db\exception\DataNotFoundException
      * @throws \think\db\exception\ModelNotFoundException
      * @throws \think\exception\DbException
-     * 
+     *
      */
     public function GetOrderProcess()
     {
@@ -289,7 +301,7 @@ class ReportingWork extends Api
             ->field('machine,date')
             ->order('machine asc,date desc')
             ->select();
-        
+
         $menuMap = [];
         foreach ($list as $row) {
             $machine = $row['machine'];

+ 3 - 4
application/api/controller/Staff.php

@@ -317,13 +317,13 @@ class Staff extends Api
 
         $where = [];
         if (!empty($params['search'])){
-            $where['a.staff_no|a.staff_name|a.team_name|a.big_process'] = array('like','%'.$params['search'].'%');
+            $where['b.staff_no|b.staff_name|a.team_name|b.big_process'] = array('like','%'.$params['search'].'%');
         }
 
         $list = Db::name('人员_小组资料')->alias('a')
             ->field('
-                a.staff_no as 员工编号,
-                a.staff_name as 员工姓名,
+                b.staff_no as 员工编号,
+                b.staff_name as 员工姓名,
                 a.*
             ')
             ->join('人员_基本资料 b', 'a.staff_no = b.staff_no')
@@ -394,7 +394,6 @@ class Staff extends Api
             'team_id' => $params['team_id'],
             'team_name' => $params['team_name'],
             'staff_no' => $params['staff_no'],
-            'staff_name' => $params['staff_name'],
             'position' => $params['position'],
             'status' => 1,
             'sys_id' => $params['sys_id'],