|
@@ -153,19 +153,24 @@ class Filing
|
|
|
//取消转单
|
|
|
public static function cancel(array $data = [])
|
|
|
{
|
|
|
+ $where = [
|
|
|
+ ['is_del', '=', 0],
|
|
|
+ ['id', '=', $data['id']],
|
|
|
+ ['supplierNo', '=', $data['supplierNo']],
|
|
|
+ ['status', 'in', [0, 1, 2, 4]]
|
|
|
+ ];
|
|
|
|
|
|
$rs = Db::name('filing')
|
|
|
->field('id,status')
|
|
|
- ->where(['is_del' => 0, 'id' => $data['id'], 'status' => 2, 'supplierNo' => $data['supplierNo']])
|
|
|
+ ->where($where)
|
|
|
->findOrEmpty();
|
|
|
- if (empty($rs)) return json_show(1005, '该报备单不存在或不是待转单状态');
|
|
|
+ if (empty($rs)) return json_show(1005, '该报备单不存在或不允许取消');
|
|
|
|
|
|
$res = Db::name('filing')
|
|
|
- ->where(['is_del' => 0, 'id' => $data['id'], 'status' => 2])
|
|
|
+ ->where($where)
|
|
|
->update(['status' => 5, 'updatetime' => date('Y-m-d H:i:s')]);
|
|
|
return $res ? json_show(0, '操作成功') : json_show(1004, '操作失败');
|
|
|
|
|
|
-
|
|
|
}
|
|
|
|
|
|
//转单
|