liuhairui 2 dní pred
rodič
commit
c9fb1ebe6b

+ 16 - 16
application/api/controller/Staff.php

@@ -20,13 +20,6 @@ class Staff extends Api
         $this->success('员工资料接口');
     }
 
-    /**
-     * 获取部门列表
-     * 一级:部门 dept_name(固定排序)
-     * 二级:工序 big_process
-     * 排序:裁剪、车缝、手工、大烫、总检、包装、其他
-     * 空工序 = 其他
-     */
     /**
      * 获取部门列表
      * 一级:部门 dept_name
@@ -382,22 +375,22 @@ class Staff extends Api
      */
     public function GetTeamStaffList()
     {
-        if (Request::instance()->isGet() == false){
+        if (Request::instance()->isGet() == false) {
             $this->error('非法请求');
         }
         $params = Request::instance()->param();
 
         $where = [];
-        if (!empty($params['search'])){
-            $where['b.staff_no|b.staff_name|a.team_name|b.big_process'] = array('like','%'.$params['search'].'%');
+        if (!empty($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('
-                b.staff_no as 员工编号,
-                b.staff_name as 员工姓名,
-                a.*
-            ')
+            b.staff_no as 员工编号,
+            b.staff_name as 员工姓名,
+            a.*
+        ')
             ->join('人员_基本资料 b', 'a.staff_no = b.staff_no')
             ->where($where)
             ->whereNull('a.mod_rq')
@@ -417,14 +410,21 @@ class Staff extends Api
                     'staff_list' => []
                 ];
             }
-            // 添加成员信息
-            $result[$teamId]['staff_list'][] = [
+
+            $member = [
                 'id' => $item['id'],
                 '员工编号' => $item['员工编号'],
                 '员工姓名' => $item['员工姓名'],
                 '小组名称' => $item['team_name'],
                 '职位' => $item['position']
             ];
+
+            // 组长排第一个
+            if ($item['position'] == '组长') {
+                array_unshift($result[$teamId]['staff_list'], $member);
+            } else {
+                $result[$teamId]['staff_list'][] = $member;
+            }
         }
 
         // 转为索引数组返回

+ 4 - 2
application/api/controller/WorkOrderSpotCheck.php

@@ -1189,6 +1189,8 @@ class WorkOrderSpotCheck extends Api{
             case '总检':
                 //判断是否为子订单编号【$order:DC2503291-0703 子订单编号】
                 if (strpos($order, '-') !== false) {
+                    //子订单编号
+
                     // 定义查询字段
                     $field = "
                             y.订单编号, y.子订单编号, y.款号, j.款式, y.颜色, 
@@ -1312,7 +1314,7 @@ class WorkOrderSpotCheck extends Api{
 
                     if ($allScslEmpty) {
                         // 当前订单未裁剪 请裁剪后报工
-                        $this->success('查询失败', [
+                        $this->success($order."\n" .'未裁剪 请裁剪后,在报工', [
                             'code' => 1,
                             'serial' => '',
                             'serial_num' => '',
@@ -1922,7 +1924,7 @@ class WorkOrderSpotCheck extends Api{
 
                     if ($allScslEmpty) {
                         // 当前子订单未裁剪 请裁剪后报工
-                        $this->success('当前子订单未裁剪 请裁剪后报工', [
+                        $this->success($order."\n" .'未裁剪 请裁剪后,在报工', [
                             'code' => 1,
                             'serial' => '',
                             'serial_num' => '',