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