unknown 7 mēneši atpakaļ
vecāks
revīzija
c60baf8876
1 mainītis faili ar 5 papildinājumiem un 8 dzēšanām
  1. 5 8
      application/api/controller/PrintingPlate.php

+ 5 - 8
application/api/controller/PrintingPlate.php

@@ -96,28 +96,26 @@ class PrintingPlate extends Api
         if (!$this->request->isGet()) {
             $this->error('请求错误');
         }
-
         $params = $this->request->param();
         if (empty($params)) {
             $this->error('参数错误');
         }
+
         $page = intval($params['page']);
         $limit = intval($params['limit']);
         $where = [];
-
-
         if (!empty($params['code'])) {
             $code = preg_match('/[a-zA-Z]/', $params['code'])
                 ? substr($params['code'], 0, 7)
                 : substr($params['code'], 0, 6);
             $where['a.存货编码'] = ['like', $code . '%'];
         }
-
-
+        if (!empty($params['key']) && isset($params['key'])) {
+            $where['a.报废日期'] = '1900-01-01 00:00:00';
+        }
         if (!empty($params['search'])) {
             $where['b.物料名称'] = ['like', '%' . $params['search'] . '%'];
         }
-
         //总数
         $total = db('产品_印版库')
         ->alias('a')
@@ -151,6 +149,7 @@ class PrintingPlate extends Api
                 'a.原始印数',
                 'a.考核印数',
                 'a.UniqID',
+                'c.UniqID as GDUID',
                 'rtrim(a.Sys_id) as 创建用户',
                 'a.Sys_rq as 创建日期',
                 'a.Mod_rq as 修改时间',
@@ -159,11 +158,9 @@ class PrintingPlate extends Api
             ])
             ->limit(($page - 1) * $limit, $limit)
             ->select();
-
         if (empty($list)) {
             $this->error('未找到相关记录');
         }
-
         $this->success('查询成功', [
             'data' => $list,
             'total' => $total,