|
@@ -7,10 +7,10 @@ use App\Http\Requests\Manager\WashConfig\ViolationStore as Request;
|
|
|
use App\Models\Manager\WashConfig\ViolationStore as ViolationStoreModel;
|
|
use App\Models\Manager\WashConfig\ViolationStore as ViolationStoreModel;
|
|
|
use App\Models\Manager\WashConfig\LowPriceGoodsCompany as LowPriceGoodsCompanyModel;
|
|
use App\Models\Manager\WashConfig\LowPriceGoodsCompany as LowPriceGoodsCompanyModel;
|
|
|
use App\Models\Manager\WashConfig\ViolationProductCompany as ViolationProductCompanyModel;
|
|
use App\Models\Manager\WashConfig\ViolationProductCompany as ViolationProductCompanyModel;
|
|
|
-
|
|
|
|
|
|
|
+use App\Models\Manager\Personnel\Employee as EmployeeModel;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * 数据清洗-违规店铺配置
|
|
|
|
|
|
|
+ * 数据清洗-违规店铺(公司)配置
|
|
|
* @author 唐远望
|
|
* @author 唐远望
|
|
|
* @version 1.0
|
|
* @version 1.0
|
|
|
* @date 2025-12-03
|
|
* @date 2025-12-03
|
|
@@ -24,7 +24,7 @@ class ViolationStore extends Controller
|
|
|
* @date 2025-12-03
|
|
* @date 2025-12-03
|
|
|
*
|
|
*
|
|
|
*/
|
|
*/
|
|
|
- public function list(Request $request, ViolationStoreModel $ViolationStoreModel)
|
|
|
|
|
|
|
+ public function list(Request $request, ViolationStoreModel $ViolationStoreModel,EmployeeModel $EmployeeModel)
|
|
|
{
|
|
{
|
|
|
$request->scene('list')->validate();
|
|
$request->scene('list')->validate();
|
|
|
// 查询条件
|
|
// 查询条件
|
|
@@ -50,9 +50,17 @@ class ViolationStore extends Controller
|
|
|
$result = $ViolationStoreModel->query()
|
|
$result = $ViolationStoreModel->query()
|
|
|
->where($map)
|
|
->where($map)
|
|
|
->orderByDesc('id')
|
|
->orderByDesc('id')
|
|
|
- ->paginate($limit);
|
|
|
|
|
|
|
+ ->paginate($limit)->toarray();
|
|
|
// 分配数据
|
|
// 分配数据
|
|
|
if (!$result) return json_send(['code' => 'error', 'msg' => '暂无数据']);
|
|
if (!$result) return json_send(['code' => 'error', 'msg' => '暂无数据']);
|
|
|
|
|
+ if (isset($result['data']) && count($result['data']) > 0) {
|
|
|
|
|
+ foreach ($result['data'] as $key => $value) {
|
|
|
|
|
+ $employee_ids = $value['employee_ids'] !='' ? explode(',', $value['employee_ids']) : '';
|
|
|
|
|
+ $result['data'][$key]['platform'] = isset($value['platform']) ? explode(',', $value['platform']) : '';
|
|
|
|
|
+ $result['data'][$key]['employee_ids'] = $employee_ids;
|
|
|
|
|
+ $result['data'][$key]['employee_name'] = $employee_ids ? $EmployeeModel->whereIn('id', $employee_ids)->pluck('name')->toArray() : '';
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
// 加载模板
|
|
// 加载模板
|
|
|
return json_send(['code' => 'success', 'msg' => '获取成功', 'data' => $result]);
|
|
return json_send(['code' => 'success', 'msg' => '获取成功', 'data' => $result]);
|
|
|
}
|
|
}
|
|
@@ -100,7 +108,7 @@ class ViolationStore extends Controller
|
|
|
* @version 1.0
|
|
* @version 1.0
|
|
|
* @date 2025-12-03
|
|
* @date 2025-12-03
|
|
|
*/
|
|
*/
|
|
|
- public function detail(Request $request, ViolationStoreModel $ViolationStoreModel)
|
|
|
|
|
|
|
+ public function detail(Request $request, ViolationStoreModel $ViolationStoreModel,EmployeeModel $EmployeeModel)
|
|
|
{
|
|
{
|
|
|
$request->scene('detail')->validate();
|
|
$request->scene('detail')->validate();
|
|
|
// 接收参数
|
|
// 接收参数
|
|
@@ -108,6 +116,9 @@ class ViolationStore extends Controller
|
|
|
$map = ['id' => $id];
|
|
$map = ['id' => $id];
|
|
|
$data = $ViolationStoreModel->where($map)->first();
|
|
$data = $ViolationStoreModel->where($map)->first();
|
|
|
if (!$data) return json_send(['code' => 'error', 'msg' => '记录不存在']);
|
|
if (!$data) return json_send(['code' => 'error', 'msg' => '记录不存在']);
|
|
|
|
|
+ $employee_ids = $data->employee_ids !='' ? explode(',', $data->employee_ids) : '';
|
|
|
|
|
+ $data->employee_ids = $employee_ids;
|
|
|
|
|
+ $data->employee_name = $employee_ids ? $EmployeeModel->whereIn('id', $employee_ids)->pluck('name')->toArray() : '';
|
|
|
// 加载模板
|
|
// 加载模板
|
|
|
return json_send(['code' => 'success', 'msg' => '获取成功', 'data' => $data]);
|
|
return json_send(['code' => 'success', 'msg' => '获取成功', 'data' => $data]);
|
|
|
}
|
|
}
|