|
|
@@ -9,6 +9,7 @@ use App\Models\Manager\WashConfig\LowPriceGoodsCompany as LowPriceGoodsCompanyMo
|
|
|
use App\Models\Manager\WashConfig\ViolationProductCompany as ViolationProductCompanyModel;
|
|
|
use App\Models\Manager\Personnel\Employee as EmployeeModel;
|
|
|
use App\Models\Manager\WashConfig\CompanyCategory as CompanyCategoryModel;
|
|
|
+use App\Models\Manager\Citys as CitysModel;
|
|
|
|
|
|
/**
|
|
|
* 数据清洗-违规店铺(公司)配置
|
|
|
@@ -25,7 +26,7 @@ class ViolationStore extends Controller
|
|
|
* @date 2025-12-03
|
|
|
*
|
|
|
*/
|
|
|
- public function list(Request $request, ViolationStoreModel $ViolationStoreModel,EmployeeModel $EmployeeModel, CompanyCategoryModel $CompanyCategoryModel)
|
|
|
+ public function list(Request $request, ViolationStoreModel $ViolationStoreModel,EmployeeModel $EmployeeModel, CompanyCategoryModel $CompanyCategoryModel,CitysModel $CitysModel)
|
|
|
{
|
|
|
$request->scene('list')->validate();
|
|
|
// 查询条件
|
|
|
@@ -63,6 +64,10 @@ class ViolationStore extends Controller
|
|
|
$result['data'][$key]['employee_ids'] = $employee_ids;
|
|
|
$result['data'][$key]['employee_name'] = $employee_ids ? $EmployeeModel->whereIn('id', $employee_ids)->pluck('name')->toArray() : '';
|
|
|
$result['data'][$key]['category_name'] = $value['category_id'] ? $CompanyCategoryModel->where('id', $value['category_id'])->value('name') : '';
|
|
|
+ $province_name = $CitysModel->get_city_name($value['province_id']);
|
|
|
+ $result['data'][$key]['province_name'] = $province_name ?? '';
|
|
|
+ $city_name = $CitysModel->get_city_name($value['city_id']);
|
|
|
+ $result['data'][$key]['city_name'] = $city_name ?? '';
|
|
|
}
|
|
|
}
|
|
|
// 加载模板
|
|
|
@@ -114,7 +119,7 @@ class ViolationStore extends Controller
|
|
|
* @version 1.0
|
|
|
* @date 2025-12-03
|
|
|
*/
|
|
|
- public function detail(Request $request, ViolationStoreModel $ViolationStoreModel,EmployeeModel $EmployeeModel, CompanyCategoryModel $CompanyCategoryModel)
|
|
|
+ public function detail(Request $request, ViolationStoreModel $ViolationStoreModel,EmployeeModel $EmployeeModel, CompanyCategoryModel $CompanyCategoryModel,CitysModel $CitysModel)
|
|
|
{
|
|
|
$request->scene('detail')->validate();
|
|
|
// 接收参数
|
|
|
@@ -126,6 +131,10 @@ class ViolationStore extends Controller
|
|
|
$data->employee_ids = $employee_ids;
|
|
|
$data->employee_name = $employee_ids ? $EmployeeModel->whereIn('id', $employee_ids)->pluck('name')->toArray() : '';
|
|
|
$data->category_name = $data->category_id ? $CompanyCategoryModel->where('id', $data->category_id)->value('name') : '';
|
|
|
+ $province_name = $CitysModel->get_city_name($data->province_id);
|
|
|
+ $data->province_name = $province_name ?? '';
|
|
|
+ $city_name = $CitysModel->get_city_name($data->city_id);
|
|
|
+ $data->city_name = $city_name ?? '';
|
|
|
// 加载模板
|
|
|
return json_send(['code' => 'success', 'msg' => '获取成功', 'data' => $data]);
|
|
|
}
|
|
|
@@ -150,6 +159,8 @@ class ViolationStore extends Controller
|
|
|
$all_data['category_id'] = $category_id;
|
|
|
$specify_responsible_person = request('specify_responsible_person', '0');
|
|
|
$all_data['specify_responsible_person'] = $specify_responsible_person;
|
|
|
+ $area_info = request('area_info', '');
|
|
|
+ $all_data['area_info'] = $area_info;
|
|
|
//查询是否存在
|
|
|
$map = ['social_credit_code' => $all_data['social_credit_code']];
|
|
|
$data = $ViolationStoreModel->where($map)->first();
|
|
|
@@ -184,6 +195,8 @@ class ViolationStore extends Controller
|
|
|
$all_data['category_id'] = $category_id;
|
|
|
$specify_responsible_person = request('specify_responsible_person', '0');
|
|
|
$all_data['specify_responsible_person'] = $specify_responsible_person;
|
|
|
+ $area_info = request('area_info', '');
|
|
|
+ $all_data['area_info'] = $area_info;
|
|
|
//查询是否存在
|
|
|
$map = ['social_credit_code' => $all_data['social_credit_code']];
|
|
|
$data = $ViolationStoreModel->where($map)->where('id', '!=', $id)->first();
|