Browse Source

查询员工优化

曹鹤洋 1 year ago
parent
commit
3b71ef2f90
1 changed files with 5 additions and 1 deletions
  1. 5 1
      application/api/controller/PackagingCountDocument.php

+ 5 - 1
application/api/controller/PackagingCountDocument.php

@@ -293,7 +293,11 @@ class PackagingCountDocument extends Api
         }else{
             $this->error('参数错误');
         }
-        $rs = db()->table('人事_基本资料')->field('rtrim(员工姓名) as ygxm')->where(['员工编号'=>$sczl_bh,'在职状态'=>'在职'])->find();
+        $rs = db()->table('人事_基本资料')->field('员工编号, rtrim(员工姓名) as ygxm')->where(['pycode'=>$sczl_bh,'在职状态'=>'在职'])->find();
+        if($rs){
+            $this->success('成功',$rs);
+        }
+        $rs = db()->table('人事_基本资料')->field('员工编号, rtrim(员工姓名) as ygxm')->where(['员工编号'=>$sczl_bh,'在职状态'=>'在职'])->find();
         if(!$rs){
             $this->error('员工编号错误');
         }