|
|
@@ -125,9 +125,9 @@ class ViolationStore extends Controller
|
|
|
$store_scope = request('store_scope', '');
|
|
|
$all_data['store_scope'] = $store_scope;
|
|
|
//查询是否存在
|
|
|
- $map = ['company_name' => $all_data['company_name']];
|
|
|
+ $map = ['social_credit_code' => $all_data['social_credit_code']];
|
|
|
$data = $ViolationStoreModel->where($map)->first();
|
|
|
- if ($data) return json_send(['code' => 'error', 'msg' => '记录已存在']);
|
|
|
+ if ($data) return json_send(['code' => 'error', 'msg' => '营业执照记录已存在']);
|
|
|
// 写入数据表
|
|
|
$result = $ViolationStoreModel->addViolationStore($all_data);
|
|
|
// 如果操作失败
|
|
|
@@ -153,9 +153,9 @@ class ViolationStore extends Controller
|
|
|
$store_scope = request('store_scope','');
|
|
|
$all_data['store_scope'] = $store_scope;
|
|
|
//查询是否存在
|
|
|
- $map = ['company_name' => $all_data['company_name']];
|
|
|
+ $map = ['social_credit_code' => $all_data['social_credit_code']];
|
|
|
$data = $ViolationStoreModel->where($map)->where('id', '!=', $id)->first();
|
|
|
- if ($data) return json_send(['code' => 'error', 'msg' => '记录已存在']);
|
|
|
+ if ($data) return json_send(['code' => 'error', 'msg' => '营业执照记录已存在']);
|
|
|
// 更新数据表
|
|
|
$where = ['id' => $id];
|
|
|
$result = $ViolationStoreModel->updateViolationStore($where, $all_data);
|