|
@@ -29,7 +29,7 @@ class Unit extends Base
|
|
|
->field('id')
|
|
|
->where(['is_del' => 0, "unit" => $param['unit']])
|
|
|
->findOrEmpty();
|
|
|
- if (!$tmp) return json_show(1004, '该单位已存在');
|
|
|
+ if (!empty($tmp)) return json_show(1004, '该单位已存在');
|
|
|
|
|
|
// $token = isset($this->post['token'])&&$this->post['token']!='' ? trim($this->post['token']):"";
|
|
|
// if($token==''){
|
|
@@ -151,7 +151,7 @@ class Unit extends Base
|
|
|
->where(['is_del' => 0, "unit" => $unit])
|
|
|
->where('id','<>',$id)
|
|
|
->findOrEmpty();
|
|
|
- if (!$tmp) return json_show(1004, '该单位已存在');
|
|
|
+ if (!empty($tmp)) return json_show(1004, '该单位已存在');
|
|
|
|
|
|
$data = [
|
|
|
"id" => $id,
|