Переглянути джерело

[智价云] 添加小程序端配置列表接口(低价挂网商品配置&违规挂网商品配置&违规店铺配置)

tangyuanwang 1 день тому
батько
коміт
1f10091097

+ 59 - 0
app/Http/Controllers/Api/WashConfig/ControlGoods.php

@@ -0,0 +1,59 @@
+<?php
+
+namespace App\Http\Controllers\Api\WashConfig;
+
+use App\Http\Controllers\Api\Api;
+use App\Http\Requests\Api\WashConfig\ControlGoods as Request;
+use App\Models\Api\WashConfig\ControlGoods as ControlGoodsModel;
+
+/**
+ * 数据清洗-强管控商品配置
+ * @author    唐远望
+ * @version   1.0
+ * @date      2025-12-15
+ */
+class ControlGoods extends Api
+{
+    /**
+     * 列表
+     * @author    唐远望
+     * @version   1.0
+     * @date      2025-12-15
+     * 
+     */
+    public function list(Request $request, ControlGoodsModel $ControlGoodsModel)
+    {
+        $user_info = $this->checkLogin();
+        if (!$user_info) return json_send(['code' => 'error', 'msg' => '请先登录']);
+        $request->scene('list')->validate();
+        // 查询条件
+        $map  = [];
+        $limit = request('limit', config('page_num', 10));
+        $status    = request('status', '0');
+        $start_time = request('start_time', '');
+        $end_time = request('end_time', '');
+        $product_name = request('product_name', '');
+        $platform = request('platform', '');
+        $store_scope = request('store_scope', '');
+        $company_scope = request('company_scope', '');
+        // 时间条件
+        if ($start_time) $map[] = ['insert_time', '>=', strtotime($start_time)];
+        if ($end_time) $map[]   = ['insert_time', '<=', strtotime($end_time)];
+        // 其他条件
+        if ($status) $map[] = ['status', '=', $status];
+        if ($product_name) $map[] = ['product_name', 'like', "%$product_name%"];
+        if ($platform) $map[] = ['platform', 'like', "%$platform%"];
+        if ($store_scope) $map[] = ['store_scope', '=', $store_scope];
+        if ($company_scope) $map[] = ['company_scope', '=', $company_scope];
+        // 查询数据
+        $result = $ControlGoodsModel->query()
+            ->where($map)
+            ->orderByDesc('id')
+            ->select(['id','product_name'])
+            ->paginate($limit);
+        // 分配数据
+        if (!$result)  return json_send(['code' => 'error', 'msg' => '暂无数据']);
+        // 加载模板
+        return        json_send(['code' => 'success', 'msg' => '获取成功', 'data' => $result]);
+    }
+}

+ 60 - 0
app/Http/Controllers/Api/WashConfig/LowPriceGoods.php

@@ -0,0 +1,60 @@
+<?php
+
+namespace App\Http\Controllers\Api\WashConfig;
+
+use App\Http\Controllers\Api\Api;
+use App\Http\Requests\Manager\WashConfig\LowPriceGoods as Request;
+use App\Models\Manager\WashConfig\LowPriceGoods as LowPriceGoodsModel;
+
+
+/**
+ * 数据清洗-低价产品配置
+ * @author    唐远望
+ * @version   1.0
+ * @date      2025-12-02
+ */
+class LowPriceGoods extends Api
+{
+    /**
+     * 列表
+     * @author    唐远望
+     * @version   1.0
+     * @date      2025-12-02
+     * 
+     */
+    public function list(Request $request, LowPriceGoodsModel $LowPriceGoodsModel)
+    {
+        $user_info = $this->checkLogin();
+        if (!$user_info) return json_send(['code' => 'error', 'msg' => '请先登录']);
+        $request->scene('list')->validate();
+        // 查询条件
+        $map  = [];
+        $limit = request('limit', config('page_num', 10));
+        $status    = request('status', '0');
+        $start_time = request('start_time', '');
+        $end_time = request('end_time', '');
+        $product_name = request('product_name', '');
+        $platform = request('platform', '');
+        $store_scope = request('store_scope', '');
+        $company_scope = request('company_scope', '');
+        // 时间条件
+        if ($start_time) $map[] = ['insert_time', '>=', strtotime($start_time)];
+        if ($end_time) $map[]   = ['insert_time', '<=', strtotime($end_time)];
+        // 其他条件
+        if (is_numeric($status)) $map[] = ['status', '=', $status];
+        if ($product_name) $map[] = ['product_name', 'like', "%$product_name%"];
+        if ($platform) $map[] = ['platform', 'like', "%$platform%"];
+        if ($store_scope) $map[] = ['store_scope', '=', $store_scope];
+        if ($company_scope) $map[] = ['company_scope', '=', $company_scope];
+        // 查询数据
+        $result = $LowPriceGoodsModel->query()
+            ->where($map)
+            ->orderByDesc('id')
+            ->select(['id','product_name'])
+            ->paginate($limit);
+        // 分配数据
+        if (!$result)  return json_send(['code' => 'error', 'msg' => '暂无数据']);
+        // 加载模板
+        return        json_send(['code' => 'success', 'msg' => '获取成功', 'data' => $result]);
+    }
+}

+ 60 - 0
app/Http/Controllers/Api/WashConfig/ViolationProduct.php

@@ -0,0 +1,60 @@
+<?php
+
+namespace App\Http\Controllers\Api\WashConfig;
+
+use App\Http\Controllers\Api\Api;
+use App\Http\Requests\Api\WashConfig\ViolationProduct as Request;
+use App\Models\Api\WashConfig\ViolationProduct as ViolationProductModel;
+
+
+/**
+ * 数据清洗-违规产品配置
+ * @author    唐远望
+ * @version   1.0
+ * @date      2025-12-03
+ */
+class ViolationProduct extends Api
+{
+    /**
+     * 列表
+     * @author    唐远望
+     * @version   1.0
+     * @date      2025-12-03
+     * 
+     */
+    public function list(Request $request, ViolationProductModel $ViolationProductModel)
+    {
+        $user_info = $this->checkLogin();
+        if (!$user_info) return json_send(['code' => 'error', 'msg' => '请先登录']);
+        $request->scene('list')->validate();
+        // 查询条件
+        $map  = [];
+        $limit = request('limit', config('page_num', 10));
+        $status    = request('status', '0');
+        $start_time = request('start_time', '');
+        $end_time = request('end_time', '');
+        $product_name = request('product_name', '');
+        $platform = request('platform', '');
+        $store_scope = request('store_scope', '');
+        $company_scope = request('company_scope', '');
+        // 时间条件
+        if ($start_time) $map[] = ['insert_time', '>=', strtotime($start_time)];
+        if ($end_time) $map[]   = ['insert_time', '<=', strtotime($end_time)];
+        // 其他条件
+        if (is_numeric($status)) $map[] = ['status', '=', $status];
+        if ($product_name) $map[] = ['product_name', 'like', "%$product_name%"];
+        if ($platform) $map[] = ['platform', 'like', "%$platform%"];
+        if ($store_scope) $map[] = ['store_scope', '=',$store_scope];
+        if ($company_scope) $map[] = ['company_scope', '=',$company_scope];
+        // 查询数据
+        $result = $ViolationProductModel->query()
+            ->where($map)
+            ->orderByDesc('id')
+            ->select(['id','product_name'])
+            ->paginate($limit);
+        // 分配数据
+        if (!$result)  return json_send(['code' => 'error', 'msg' => '暂无数据']);
+        // 加载模板
+        return        json_send(['code' => 'success', 'msg' => '获取成功', 'data' => $result]);
+    }
+}

+ 60 - 0
app/Http/Controllers/Api/WashConfig/ViolationStore.php

@@ -0,0 +1,60 @@
+<?php
+
+namespace App\Http\Controllers\Api\WashConfig;
+
+use App\Http\Controllers\Api\Api;
+use App\Http\Requests\Api\WashConfig\ViolationStore as Request;
+use App\Models\Api\WashConfig\ViolationStore as ViolationStoreModel;
+
+
+/**
+ * 数据清洗-违规店铺(公司)配置
+ * @author    唐远望
+ * @version   1.0
+ * @date      2025-12-03
+ */
+class ViolationStore extends Api
+{
+    /**
+     * 列表
+     * @author    唐远望
+     * @version   1.0
+     * @date      2025-12-03
+     * 
+     */
+    public function list(Request $request, ViolationStoreModel $ViolationStoreModel)
+    {
+        $user_info = $this->checkLogin();
+        if (!$user_info) return json_send(['code' => 'error', 'msg' => '请先登录']);
+        $request->scene('list')->validate();
+        // 查询条件
+        $map  = [];
+        $limit = request('limit', config('page_num', 10));
+        $status    = request('status', '0');
+        $start_time = request('start_time', '');
+        $end_time = request('end_time', '');
+        $store_name = request('store_name', '');
+        $company_name = request('company_name', '');
+        $social_credit_code = request('social_credit_code', '');
+        $store_type = request('store_type', '');
+        // 时间条件
+        if ($start_time) $map[] = ['insert_time', '>=', strtotime($start_time)];
+        if ($end_time) $map[]   = ['insert_time', '<=', strtotime($end_time)];
+        // 其他条件
+        if (is_numeric($status)) $map[] = ['status', '=', $status];
+        if ($social_credit_code) $map[] = ['social_credit_code', 'like', "%$social_credit_code%"];
+        if ($company_name) $map[] = ['company_name', 'like', "%$company_name%"];
+        if ($store_name) $map[] = ['store_name', 'like', "%$store_name%"];
+        if ($store_type) $map[] = ['store_type', '=', $store_type];
+        // 查询数据
+        $result = $ViolationStoreModel->query()
+            ->where($map)
+            ->orderByDesc('id')
+            ->select(['id','company_name'])
+            ->paginate($limit);
+        // 分配数据
+        if (!$result)  return json_send(['code' => 'error', 'msg' => '暂无数据']);
+        // 加载模板
+        return        json_send(['code' => 'success', 'msg' => '获取成功', 'data' => $result]);
+    }
+}

+ 83 - 0
app/Http/Requests/Api/WashConfig/ControlGoods.php

@@ -0,0 +1,83 @@
+<?php
+
+namespace App\Http\Requests\Api\WashConfig;
+
+use App\Http\Requests\BaseRequest;
+
+/**
+ * 数据清洗配置-强管控商品
+ * @author 唐远望
+ * @version 1.0
+ * @date 2025-12-15
+ * 
+ */
+class ControlGoods extends BaseRequest
+{
+    /**
+     * 获取应用于请求的规则
+     *
+     * @return array
+     */
+    public function rules()
+    {
+        // 返回结果
+        return      [
+            'name'                 => 'required',
+            'id'                => 'required|integer|gt:0',
+            'status'            => 'required|integer|in:0,1',
+            'page'              => 'integer|min:1',
+            'limit'             => 'integer|min:1',
+            'image_url'         => 'required',
+            'link_url'          => 'required',
+            'sort'              => 'required|integer|min:0',
+            'product_name'      => 'required',
+            'product_specs'     => 'required',
+            'suggested_price'   => 'required',
+            'store_scope'       => 'required',
+            'platform'          => 'required',
+        ];
+    }
+
+
+    // 场景列表
+    protected   $scenes         = [
+        'detail'             => ['id'],
+        'list'               => ['page', 'limit'],
+        'add'                      => ['platform','product_name', 'product_specs'],
+        'edit'                  => ['id','platform','product_name', 'product_specs'],
+        'set_status'              => ['id', 'status'],
+        'delete'                  => ['id'],
+    ];
+
+    /**
+     * 获取已定义验证规则的错误消息
+     *
+     * @return array
+     */
+    public function messages()
+    {
+        return [
+            'name.required'     => '名称必填',
+            'id.required'       => 'ID未知',
+            'id.integer'        => 'ID格式错误',
+            'id.gt'               => 'ID格式错误',
+            'status.required'   => '状态未知',
+            'status.integer'    => '状态格式错误',
+            'status.in'         => '状态格式错误',
+            'page.integer'      => '页码格式错误',
+            'page.min'          => '页码格式错误',
+            'limit.integer'     => '每页数量格式错误',
+            'limit.min'         => '每页数量格式错误',
+            'image_url.required'    => '图片链接未知',
+            'link_url.required'     => '链接地址未知',
+            'sort.required'         => '排序未知',
+            'sort.integer'          => '排序格式错误',
+            'sort.min'              => '排序格式错误',
+            'product_name.required' => '商品名称未知',
+            'product_specs.required'    => '商品规格未知',
+            'suggested_price.required' => '建议价格未知',
+            'store_scope.required'    => '适用门店未知',
+            'platform.required'     => '平台未知',
+        ];
+    }
+}

+ 83 - 0
app/Http/Requests/Api/WashConfig/LowPriceGoods.php

@@ -0,0 +1,83 @@
+<?php
+
+namespace App\Http\Requests\Api\WashConfig;
+
+use App\Http\Requests\BaseRequest;
+
+/**
+ * 数据清洗配置-低价商品
+ * @author 唐远望
+ * @version 1.0
+ * @date 2025-12-15
+ * 
+ */
+class LowPriceGoods extends BaseRequest
+{
+    /**
+     * 获取应用于请求的规则
+     *
+     * @return array
+     */
+    public function rules()
+    {
+        // 返回结果
+        return      [
+            'name'                 => 'required',
+            'id'                => 'required|integer|gt:0',
+            'status'            => 'required|integer|in:0,1',
+            'page'              => 'integer|min:1',
+            'limit'             => 'integer|min:1',
+            'image_url'         => 'required',
+            'link_url'          => 'required',
+            'sort'              => 'required|integer|min:0',
+            'product_name'      => 'required',
+            'product_specs'     => 'required',
+            'suggested_price'   => 'required',
+            'store_scope'       => 'required',
+            'platform'          => 'required',
+        ];
+    }
+
+
+    // 场景列表
+    protected   $scenes         = [
+        'detail'             => ['id'],
+        'list'               => ['page', 'limit'],
+        'add'                      => ['platform','product_name', 'product_specs', 'suggested_price'],
+        'edit'                  => ['id','platform', 'product_name', 'product_specs', 'suggested_price'],
+        'set_status'              => ['id', 'status'],
+        'delete'                  => ['id'],
+    ];
+
+    /**
+     * 获取已定义验证规则的错误消息
+     *
+     * @return array
+     */
+    public function messages()
+    {
+        return [
+            'name.required'     => '名称必填',
+            'id.required'       => 'ID未知',
+            'id.integer'        => 'ID格式错误',
+            'id.gt'               => 'ID格式错误',
+            'status.required'   => '状态未知',
+            'status.integer'    => '状态格式错误',
+            'status.in'         => '状态格式错误',
+            'page.integer'      => '页码格式错误',
+            'page.min'          => '页码格式错误',
+            'limit.integer'     => '每页数量格式错误',
+            'limit.min'         => '每页数量格式错误',
+            'image_url.required'    => '图片链接未知',
+            'link_url.required'     => '链接地址未知',
+            'sort.required'         => '排序未知',
+            'sort.integer'          => '排序格式错误',
+            'sort.min'              => '排序格式错误',
+            'product_name.required' => '商品名称未知',
+            'product_specs.required'    => '商品规格未知',
+            'suggested_price.required' => '建议价格未知',
+            'store_scope.required'    => '适用门店未知',
+            'platform.required'     => '平台未知',
+        ];
+    }
+}

+ 83 - 0
app/Http/Requests/Api/WashConfig/ViolationProduct.php

@@ -0,0 +1,83 @@
+<?php
+
+namespace App\Http\Requests\Api\WashConfig;
+
+use App\Http\Requests\BaseRequest;
+
+/**
+ * 数据清洗配置-违规商品
+ * @author 唐远望
+ * @version 1.0
+ * @date 2025-12-15
+ * 
+ */
+class ViolationProduct extends BaseRequest
+{
+    /**
+     * 获取应用于请求的规则
+     *
+     * @return array
+     */
+    public function rules()
+    {
+        // 返回结果
+        return      [
+            'name'                 => 'required',
+            'id'                => 'required|integer|gt:0',
+            'status'            => 'required|integer|in:0,1',
+            'page'              => 'integer|min:1',
+            'limit'             => 'integer|min:1',
+            'image_url'         => 'required',
+            'link_url'          => 'required',
+            'sort'              => 'required|integer|min:0',
+            'product_name'      => 'required',
+            'product_specs'     => 'required',
+            'suggested_price'   => 'required',
+            'store_scope'       => 'required',
+            'platform'          => 'required',
+        ];
+    }
+
+
+    // 场景列表
+    protected   $scenes         = [
+        'detail'             => ['id'],
+        'list'               => ['page', 'limit'],
+        'add'                      => ['platform','product_name', 'product_specs'],
+        'edit'                  => ['id','platform','product_name', 'product_specs'],
+        'set_status'              => ['id', 'status'],
+        'delete'                  => ['id'],
+    ];
+
+    /**
+     * 获取已定义验证规则的错误消息
+     *
+     * @return array
+     */
+    public function messages()
+    {
+        return [
+            'name.required'     => '名称必填',
+            'id.required'       => 'ID未知',
+            'id.integer'        => 'ID格式错误',
+            'id.gt'               => 'ID格式错误',
+            'status.required'   => '状态未知',
+            'status.integer'    => '状态格式错误',
+            'status.in'         => '状态格式错误',
+            'page.integer'      => '页码格式错误',
+            'page.min'          => '页码格式错误',
+            'limit.integer'     => '每页数量格式错误',
+            'limit.min'         => '每页数量格式错误',
+            'image_url.required'    => '图片链接未知',
+            'link_url.required'     => '链接地址未知',
+            'sort.required'         => '排序未知',
+            'sort.integer'          => '排序格式错误',
+            'sort.min'              => '排序格式错误',
+            'product_name.required' => '商品名称未知',
+            'product_specs.required'    => '商品规格未知',
+            'suggested_price.required' => '建议价格未知',
+            'store_scope.required'    => '适用门店未知',
+            'platform.required'      => '平台未知',
+        ];
+    }
+}

+ 82 - 0
app/Http/Requests/Api/WashConfig/ViolationStore.php

@@ -0,0 +1,82 @@
+<?php
+
+namespace App\Http\Requests\Api\WashConfig;
+
+use App\Http\Requests\BaseRequest;
+
+/**
+ * 数据清洗配置-违规店铺
+ * @author 唐远望
+ * @version 1.0
+ * @date 2025-12-15
+ * 
+ */
+class ViolationStore extends BaseRequest
+{
+    /**
+     * 获取应用于请求的规则
+     *
+     * @return array
+     */
+    public function rules()
+    {
+        // 返回结果
+        return      [
+            'name'                 => 'required',
+            'id'                => 'required|integer|gt:0',
+            'status'            => 'required|integer|in:0,1',
+            'page'              => 'integer|min:1',
+            'limit'             => 'integer|min:1',
+            'image_url'         => 'required',
+            'link_url'          => 'required',
+            'sort'              => 'required|integer|min:0',
+            'store_name'        => 'required',
+            'company_name'      => 'required',
+            'social_credit_code'    => 'required',
+            'store_type'        => 'required',
+        ];
+    }
+
+
+    // 场景列表
+    protected   $scenes         = [
+        'detail'             => ['id'],
+        'list'               => ['page', 'limit'],
+        'add'                      => ['company_name', 'social_credit_code', 'store_type'],
+        'edit'                  => ['id','company_name', 'social_credit_code', 'store_type'],
+        'set_status'              => ['id', 'status'],
+        'delete'                  => ['id'],
+        'all'                    => [''],
+    ];
+
+    /**
+     * 获取已定义验证规则的错误消息
+     *
+     * @return array
+     */
+    public function messages()
+    {
+        return [
+            'name.required'     => '名称必填',
+            'id.required'       => 'ID未知',
+            'id.integer'        => 'ID格式错误',
+            'id.gt'               => 'ID格式错误',
+            'status.required'   => '状态未知',
+            'status.integer'    => '状态格式错误',
+            'status.in'         => '状态格式错误',
+            'page.integer'      => '页码格式错误',
+            'page.min'          => '页码格式错误',
+            'limit.integer'     => '每页数量格式错误',
+            'limit.min'         => '每页数量格式错误',
+            'image_url.required'    => '图片链接未知',
+            'link_url.required'     => '链接地址未知',
+            'sort.required'         => '排序未知',
+            'sort.integer'          => '排序格式错误',
+            'sort.min'              => '排序格式错误',
+            'store_name.required'    => '店铺名称未知',
+            'company_name.required'  => '公司名称未知',
+            'social_credit_code.required'  => '社会信用代码未知',
+            'store_type.required'    => '店铺类型未知',
+        ];
+    }
+}

+ 202 - 0
app/Models/Api/WashConfig/ControlGoods.php

@@ -0,0 +1,202 @@
+<?php
+
+namespace App\Models\Api\WashConfig;
+
+use Illuminate\Database\Eloquent\Factories\HasFactory;
+use Illuminate\Database\Eloquent\Model;
+use Illuminate\Support\Facades\DB;
+use App\Models\Api\WashConfig\ControlGoodsCompany as ControlGoodsCompanyModel;
+
+
+/**
+ * 清洗配置-强管控商品模型
+ * @author: 唐远望
+ * @version: 1.0
+ * @date: 2025-12-15
+ */
+class ControlGoods extends Model
+{
+    use HasFactory;
+    // 与模型关联的表名
+    protected $table = 'washconfig_control_product';
+    // 是否主动维护时间戳
+    public $timestamps = false;
+    // 定义时间戳字段名
+    // const CREATED_AT = 'insert_time';
+    // const UPDATED_AT = 'update_time';
+
+
+    /**
+     * 添加
+     * @author 唐远望
+     * @version 1.0
+     * @date 2025-12-15
+     */
+    public function addControlGoods_content($data)
+    {
+        $insert_data = [
+            'platform' => $data['platform'],
+            'product_name' => $data['product_name'],
+            'product_specs' => $data['product_specs'],
+            'store_scope'    => $data['store_scope'],
+            'insert_time' => time(),
+        ];
+        $ControlGoods_id = $this->insertGetId($insert_data);
+        return $ControlGoods_id;
+    }
+
+
+    /**
+     * 写入数据
+     * @author 唐远望
+     * @version 1.0
+     * @date 2025-12-15
+     * @param $data
+     * @return bool
+     */
+    public function addControlGoods($data)
+    {
+        DB::beginTransaction();
+        try {
+            $ControlGoodsCompanyModel = new ControlGoodsCompanyModel();
+            $insert_data = [
+                'platform' => $data['platform'],
+                'product_name' => $data['product_name'],
+                'product_specs' => $data['product_specs'],
+                'store_scope'    => isset($data['store_scope']) && $data['store_scope'] !='' ? 2 : 1, //店铺范围1=全部店铺 2=指定店铺
+                'company_scope'    => isset($data['company_scope']) && $data['company_scope'] !='' ? 2 : 1, //公司范围1=全部公司 2=指定公司
+                'insert_time' => time(),
+            ];
+            $ControlGoods_id = $this->insertGetId($insert_data);
+            if ($insert_data['company_scope'] == 2) {
+                $insert_company_data = [];
+                $company_scope = explode(',', $data['company_scope']);
+                foreach ($company_scope as $company_id) {
+                    $insert_company_data[] = [
+                        'control_product_logid' => $ControlGoods_id,
+                        'company_id' => $company_id,
+                    ];
+                }
+                $ControlGoodsCompanyModel->insert($insert_company_data);
+            }
+            DB::commit();
+            return true;
+            // 成功处理...
+        } catch (\Exception $e) {
+            DB::rollBack();
+            // 错误处理...
+            return false;
+        }
+    }
+
+
+    /**
+     * 编辑内容
+     * @author 唐远望
+     * @version 1.0
+     * @date 2025-12-15
+     * @param $data
+     * @return bool
+     */
+    public function editControlGoods_content($where, $data)
+    {
+        $ControlGoods = $this->where($where)->first();
+        if (!$ControlGoods) {
+            return false;
+        }
+        DB::beginTransaction();
+        try {
+            $ControlGoodsCompanyModel = new ControlGoodsCompanyModel();
+            $ControlGoods->platform = $data['platform'];
+            $ControlGoods->product_name = $data['product_name'];
+            $ControlGoods->product_specs = $data['product_specs'];
+            $ControlGoods->store_scope = $data['store_scope'];
+            $ControlGoods->update_time = time();
+            $ControlGoods->save();
+
+            $ControlGoodsCompanyModel->where('control_product_logid', $ControlGoods->id)->delete();
+            if ($data['company_scope'] == 2) {
+                $insert_company_data = [];
+                $company_scope = explode(',', $data['company_scope']);
+                foreach ($company_scope as $company_id) {
+                    $insert_company_data[] = [
+                        'control_product_logid' => $ControlGoods->id,
+                        'company_id' => $company_id,
+                    ];
+                }
+                $ControlGoodsCompanyModel->insert($insert_company_data);
+            }
+            DB::commit();
+            return true;
+            // 成功处理...
+        } catch (\Exception $e) {
+            DB::rollBack();
+            // 错误处理...
+            return false;
+        }
+    }
+
+
+
+    /**
+     * 更新数据
+     * @author 唐远望
+     * @version 1.0
+     * @date 2025-12-15
+     * @param $data
+     * @return bool
+     */
+    public function updateControlGoods($where, $data)
+    {
+        DB::beginTransaction();
+        try {
+            $this->editControlGoods_content($where, $data);
+            DB::commit();
+            return true;
+            // 成功处理...
+        } catch (\Exception $e) {
+            DB::rollBack();
+            // 错误处理...
+            return false;
+        }
+    }
+
+    /**
+     * 修改状态
+     * @author 唐远望
+     * @version 1.0
+     * @date 2025-12-15
+     * @param $id
+     * @param $status
+     * @return bool
+     */
+    public function changeStatus($where, $status)
+    {
+        $ControlGoods = $this->where($where)->first();
+        if (!$ControlGoods) {
+            return false;
+        }
+        $ControlGoods->status = $status;
+        $ControlGoods->update_time = time();
+        $ControlGoods->save();
+        return true;
+    }
+
+    /**
+     * 删除数据
+     * @author 唐远望
+     * @version 1.0
+     * @date 2025-12-15
+     * @param $id
+     * @return bool
+     */
+    public function deleteControlGoods($where)
+    {
+        $ControlGoods = $this->where($where)->first();
+        if (!$ControlGoods) {
+            return false;
+        }
+        $ControlGoods->delete();
+        return true;
+    }
+}

+ 26 - 0
app/Models/Api/WashConfig/ControlGoodsCompany.php

@@ -0,0 +1,26 @@
+<?php
+
+namespace App\Models\Api\WashConfig;
+
+use Illuminate\Database\Eloquent\Factories\HasFactory;
+use Illuminate\Database\Eloquent\Model;
+
+
+/**
+ * 清洗配置-强管控商品公司关系模型
+ * @author: 唐远望
+ * @version: 1.0
+ * @date: 2025-12-15
+ */
+class ControlGoodsCompany extends Model
+{
+    use HasFactory;
+    // 与模型关联的表名
+    protected $table = 'washconfig_control_product_company';
+    // 是否主动维护时间戳
+    public $timestamps = false;
+    // 定义时间戳字段名
+    // const CREATED_AT = 'insert_time';
+    // const UPDATED_AT = 'update_time';
+
+}

+ 206 - 0
app/Models/Api/WashConfig/LowPriceGoods.php

@@ -0,0 +1,206 @@
+<?php
+
+namespace App\Models\Api\WashConfig;
+
+use Illuminate\Database\Eloquent\Factories\HasFactory;
+use Illuminate\Database\Eloquent\Model;
+use Illuminate\Support\Facades\DB;
+use App\Models\Api\WashConfig\LowPriceGoodsCompany as LowPriceGoodsCompanyModel;
+
+
+/**
+ * 清洗配置-低价商品
+ * @author: 唐远望
+ * @version: 1.0
+ * @date: 2025-12-15
+ */
+class LowPriceGoods extends Model
+{
+    use HasFactory;
+    // 与模型关联的表名
+    protected $table = 'washconfig_lowprice_product';
+    // 是否主动维护时间戳
+    public $timestamps = false;
+    // 定义时间戳字段名
+    // const CREATED_AT = 'insert_time';
+    // const UPDATED_AT = 'update_time';
+
+
+    /**
+     * 添加
+     * @author 唐远望
+     * @version 1.0
+     * @date 2025-12-15
+     */
+    public function addLowProduct_content($data)
+    {
+        $insert_data = [
+            'platform' => $data['platform'],
+            'product_name' => $data['product_name'],
+            'product_specs' => $data['product_specs'],
+            'suggested_price' => $data['suggested_price'],
+            'store_scope'    => $data['store_scope'],
+            'insert_time' => time(),
+        ];
+        $LowProduct_id = $this->insertGetId($insert_data);
+        return $LowProduct_id;
+    }
+
+
+    /**
+     * 写入数据
+     * @author 唐远望
+     * @version 1.0
+     * @date 2025-12-15
+     * @param $data
+     * @return bool
+     */
+    public function addLowProduct($data)
+    {
+        DB::beginTransaction();
+        try {
+            $LowPriceGoodsCompanyModel = new LowPriceGoodsCompanyModel();
+            $insert_data = [
+                'platform' => $data['platform'],
+                'product_name' => $data['product_name'],
+                'product_specs' => $data['product_specs'],
+                'suggested_price' => $data['suggested_price'],
+                'store_scope'    => isset($data['store_scope']) && $data['store_scope'] !='' ? 2 : 1, //店铺范围1=全部店铺 2=指定店铺
+                'company_scope'    => isset($data['company_scope']) && $data['company_scope'] !='' ? 2 : 1, //公司范围1=全部公司 2=指定公司
+                'insert_time' => time(),
+            ];
+            $LowProduct_id = $this->insertGetId($insert_data);
+            if ($insert_data['company_scope'] == 2) {
+                $insert_company_data = [];
+                $company_scope = explode(',', $data['company_scope']);
+                foreach ($company_scope as $company_id) {
+                    $insert_company_data[] = [
+                        'lowprice_product_logid' => $LowProduct_id,
+                        'company_id' => $company_id,
+                    ];
+                }
+                $LowPriceGoodsCompanyModel->insert($insert_company_data);
+            }
+            DB::commit();
+            return true;
+            // 成功处理...
+        } catch (\Exception $e) {
+            DB::rollBack();
+            // 错误处理...
+            return false;
+        }
+    }
+
+
+    /**
+     * 编辑内容
+     * @author 唐远望
+     * @version 1.0
+     * @date 2025-12-15
+     * @param $data
+     * @return bool
+     */
+    public function editLowProduct_content($where, $data)
+    {
+        $LowProduct = $this->where($where)->first();
+        if (!$LowProduct) {
+            return false;
+        }
+        DB::beginTransaction();
+        try {
+            $LowPriceGoodsCompanyModel = new LowPriceGoodsCompanyModel();
+            $LowProduct->platform = $data['platform'];
+            $LowProduct->product_name = $data['product_name'];
+            $LowProduct->product_specs = $data['product_specs'];
+            $LowProduct->suggested_price = $data['suggested_price'];
+            $LowProduct->store_scope = $data['store_scope'] ? 2 : 1; //店铺范围1=全部店铺 2=指定店铺
+            $LowProduct->company_scope = $data['company_scope'] ? 2 : 1; //公司范围1=全部公司 2=指定公司
+            $LowProduct->update_time = time();
+            $LowProduct->save();
+
+            $LowPriceGoodsCompanyModel->where('lowprice_product_logid', $LowProduct->id)->delete();
+            if ($data['company_scope'] == 2) {
+                $insert_company_data = [];
+                $company_scope = explode(',', $data['company_scope']);
+                foreach ($company_scope as $company_id) {
+                    $insert_company_data[] = [
+                        'lowprice_product_logid' => $LowProduct->id,
+                        'company_id' => $company_id,
+                    ];
+                }
+                $LowPriceGoodsCompanyModel->insert($insert_company_data);
+            }
+            DB::commit();
+            return true;
+            // 成功处理...
+        } catch (\Exception $e) {
+            DB::rollBack();
+            // 错误处理...
+            return false;
+        }
+    }
+
+
+
+    /**
+     * 更新数据
+     * @author 唐远望
+     * @version 1.0
+     * @date 2025-12-15
+     * @param $data
+     * @return bool
+     */
+    public function updateLowProduct($where, $data)
+    {
+        DB::beginTransaction();
+        try {
+            $this->editLowProduct_content($where, $data);
+            DB::commit();
+            return true;
+            // 成功处理...
+        } catch (\Exception $e) {
+            DB::rollBack();
+            // 错误处理...
+            return false;
+        }
+    }
+
+    /**
+     * 修改状态
+     * @author 唐远望
+     * @version 1.0
+     * @date 2025-12-15
+     * @param $id
+     * @param $status
+     * @return bool
+     */
+    public function changeStatus($where, $status)
+    {
+        $LowProduct = $this->where($where)->first();
+        if (!$LowProduct) {
+            return false;
+        }
+        $LowProduct->status = $status;
+        $LowProduct->update_time = time();
+        $LowProduct->save();
+        return true;
+    }
+
+    /**
+     * 删除数据
+     * @author 唐远望
+     * @version 1.0
+     * @date 2025-12-15
+     * @param $id
+     * @return bool
+     */
+    public function deleteLowProduct($where)
+    {
+        $LowProduct = $this->where($where)->first();
+        if (!$LowProduct) {
+            return false;
+        }
+        $LowProduct->delete();
+        return true;
+    }
+}

+ 26 - 0
app/Models/Api/WashConfig/LowPriceGoodsCompany.php

@@ -0,0 +1,26 @@
+<?php
+
+namespace App\Models\Api\WashConfig;
+
+use Illuminate\Database\Eloquent\Factories\HasFactory;
+use Illuminate\Database\Eloquent\Model;
+
+
+/**
+ * 清洗配置-低价商品公司关系模型
+ * @author: 唐远望
+ * @version: 1.0
+ * @date: 2025-12-15
+ */
+class LowPriceGoodsCompany extends Model
+{
+    use HasFactory;
+    // 与模型关联的表名
+    protected $table = 'washconfig_lowprice_product_company';
+    // 是否主动维护时间戳
+    public $timestamps = false;
+    // 定义时间戳字段名
+    // const CREATED_AT = 'insert_time';
+    // const UPDATED_AT = 'update_time';
+
+}

+ 26 - 0
app/Models/Api/WashConfig/ViolationCompanyMember.php

@@ -0,0 +1,26 @@
+<?php
+
+namespace App\Models\Api\WashConfig;
+
+use Illuminate\Database\Eloquent\Factories\HasFactory;
+use Illuminate\Database\Eloquent\Model;
+
+
+/**
+ * 清洗配置-违规公司人员跟进模型
+ * @author: 唐远望
+ * @version: 1.0
+ * @date: 2025-12-15
+ */
+class ViolationCompanyMember extends Model
+{
+    use HasFactory;
+    // 与模型关联的表名
+    protected $table = 'washconfig_violation_company_member';
+    // 是否主动维护时间戳
+    public $timestamps = false;
+    // 定义时间戳字段名
+    // const CREATED_AT = 'insert_time';
+    // const UPDATED_AT = 'update_time';
+
+}

+ 202 - 0
app/Models/Api/WashConfig/ViolationProduct.php

@@ -0,0 +1,202 @@
+<?php
+
+namespace App\Models\Api\WashConfig;
+
+use Illuminate\Database\Eloquent\Factories\HasFactory;
+use Illuminate\Database\Eloquent\Model;
+use Illuminate\Support\Facades\DB;
+use App\Models\Manager\WashConfig\ViolationProductCompany as ViolationProductCompanyModel;
+
+
+/**
+ * 清洗配置-违规商品
+ * @author: 唐远望
+ * @version: 1.0
+ * @date: 2025-12-15
+ */
+class ViolationProduct extends Model
+{
+    use HasFactory;
+    // 与模型关联的表名
+    protected $table = 'washconfig_violation_product';
+    // 是否主动维护时间戳
+    public $timestamps = false;
+    // 定义时间戳字段名
+    // const CREATED_AT = 'insert_time';
+    // const UPDATED_AT = 'update_time';
+
+
+    /**
+     * 添加
+     * @author 唐远望
+     * @version 1.0
+     * @date 2025-12-15
+     */
+    public function addViolationProduct_content($data)
+    {
+        $insert_data = [
+            'platform' => $data['platform'],
+            'product_name' => $data['product_name'],
+            'product_specs' => $data['product_specs'],
+            'store_scope'    => $data['store_scope'],
+            'insert_time' => time(),
+        ];
+        $ViolationProduct_id = $this->insertGetId($insert_data);
+        return $ViolationProduct_id;
+    }
+
+
+    /**
+     * 写入数据
+     * @author 唐远望
+     * @version 1.0
+     * @date 2025-12-15
+     * @param $data
+     * @return bool
+     */
+    public function addViolationProduct($data)
+    {
+        DB::beginTransaction();
+        try {
+            $ViolationProductCompanyModel = new ViolationProductCompanyModel();
+            $insert_data = [
+                'platform' => $data['platform'],
+                'product_name' => $data['product_name'],
+                'product_specs' => $data['product_specs'],
+                'store_scope'    => isset($data['store_scope']) && $data['store_scope'] !='' ? 2 : 1, //店铺范围1=全部店铺 2=指定店铺
+                'company_scope'    => isset($data['company_scope']) && $data['company_scope'] !='' ? 2 : 1, //公司范围1=全部公司 2=指定公司
+                'insert_time' => time(),
+            ];
+            $ViolationProduct_id = $this->insertGetId($insert_data);
+            if ($insert_data['company_scope'] == 2) {
+                $insert_company_data = [];
+                $company_scope = explode(',', $data['company_scope']);
+                foreach ($company_scope as $company_id) {
+                    $insert_company_data[] = [
+                        'violation_product_logid' => $ViolationProduct_id,
+                        'company_id' => $company_id,
+                    ];
+                }
+                $ViolationProductCompanyModel->insert($insert_company_data);
+            }
+            DB::commit();
+            return true;
+            // 成功处理...
+        } catch (\Exception $e) {
+            DB::rollBack();
+            // 错误处理...
+            return false;
+        }
+    }
+
+
+    /**
+     * 编辑内容
+     * @author 唐远望
+     * @version 1.0
+     * @date 2025-12-15
+     * @param $data
+     * @return bool
+     */
+    public function editViolationProduct_content($where, $data)
+    {
+        $ViolationProduct = $this->where($where)->first();
+        if (!$ViolationProduct) {
+            return false;
+        }
+        DB::beginTransaction();
+        try {
+            $ViolationProductCompanyModel = new ViolationProductCompanyModel();
+            $ViolationProduct->platform = $data['platform'];
+            $ViolationProduct->product_name = $data['product_name'];
+            $ViolationProduct->product_specs = $data['product_specs'];
+            $ViolationProduct->store_scope = $data['store_scope'];
+            $ViolationProduct->update_time = time();
+            $ViolationProduct->save();
+            DB::commit();
+
+            $ViolationProductCompanyModel->where('violation_product_logid', $ViolationProduct->id)->delete();
+            if ($data['company_scope'] == 2) {
+                $insert_company_data = [];
+                $company_scope = explode(',', $data['company_scope']);
+                foreach ($company_scope as $company_id) {
+                    $insert_company_data[] = [
+                        'violation_product_logid' => $ViolationProduct->id,
+                        'company_id' => $company_id,
+                    ];
+                }
+                $ViolationProductCompanyModel->insert($insert_company_data);
+            }
+            return true;
+            // 成功处理...
+        } catch (\Exception $e) {
+            DB::rollBack();
+            // 错误处理...
+            return false;
+        }
+    }
+
+
+
+    /**
+     * 更新数据
+     * @author 唐远望
+     * @version 1.0
+     * @date 2025-12-15
+     * @param $data
+     * @return bool
+     */
+    public function updateViolationProduct($where, $data)
+    {
+        DB::beginTransaction();
+        try {
+            $this->editViolationProduct_content($where, $data);
+            DB::commit();
+            return true;
+            // 成功处理...
+        } catch (\Exception $e) {
+            DB::rollBack();
+            // 错误处理...
+            return false;
+        }
+    }
+
+    /**
+     * 修改状态
+     * @author 唐远望
+     * @version 1.0
+     * @date 2025-12-15
+     * @param $id
+     * @param $status
+     * @return bool
+     */
+    public function changeStatus($where, $status)
+    {
+        $ViolationProduct = $this->where($where)->first();
+        if (!$ViolationProduct) {
+            return false;
+        }
+        $ViolationProduct->status = $status;
+        $ViolationProduct->update_time = time();
+        $ViolationProduct->save();
+        return true;
+    }
+
+    /**
+     * 删除数据
+     * @author 唐远望
+     * @version 1.0
+     * @date 2025-12-15
+     * @param $id
+     * @return bool
+     */
+    public function deleteViolationProduct($where)
+    {
+        $ViolationProduct = $this->where($where)->first();
+        if (!$ViolationProduct) {
+            return false;
+        }
+        $ViolationProduct->delete();
+        return true;
+    }
+}

+ 27 - 0
app/Models/Api/WashConfig/ViolationProductCompany.php

@@ -0,0 +1,27 @@
+<?php
+
+namespace App\Models\Api\WashConfig;
+
+use Illuminate\Database\Eloquent\Factories\HasFactory;
+use Illuminate\Database\Eloquent\Model;
+use Illuminate\Support\Facades\DB;
+
+
+/**
+ * 清洗配置-违规商品公司关系模型
+ * @author: 唐远望
+ * @version: 1.0
+ * @date: 2025-12-15
+ */
+class ViolationProductCompany extends Model
+{
+    use HasFactory;
+    // 与模型关联的表名
+    protected $table = 'washconfig_violation_product_company';
+    // 是否主动维护时间戳
+    public $timestamps = false;
+    // 定义时间戳字段名
+    // const CREATED_AT = 'insert_time';
+    // const UPDATED_AT = 'update_time';
+
+}

+ 201 - 0
app/Models/Api/WashConfig/ViolationStore.php

@@ -0,0 +1,201 @@
+<?php
+
+namespace App\Models\Api\WashConfig;
+
+use Illuminate\Database\Eloquent\Factories\HasFactory;
+use Illuminate\Database\Eloquent\Model;
+use Illuminate\Support\Facades\DB;
+use App\Models\Api\WashConfig\ViolationCompanyMember as ViolationCompanyMemberModel;
+
+
+/**
+ * 清洗配置-违规店铺
+ * @author: 唐远望
+ * @version: 1.0
+ * @date: 2025-12-15
+ */
+class ViolationStore extends Model
+{
+    use HasFactory;
+    // 与模型关联的表名
+    protected $table = 'washconfig_violation_store';
+    // 是否主动维护时间戳
+    public $timestamps = false;
+    // 定义时间戳字段名
+    // const CREATED_AT = 'insert_time';
+    // const UPDATED_AT = 'update_time';
+
+
+
+    /**
+     * 添加
+     * @author 唐远望
+     * @version 1.0
+     * @date 2025-12-15
+     */
+    public function addViolationStore_content($data)
+    {
+        $insert_data = [
+            'company_name' => $data['company_name'],
+            'social_credit_code'    => $data['social_credit_code'],
+            'store_type'    => $data['store_type'],
+            'insert_time' => time(),
+        ];
+        $ViolationStore_id = $this->insertGetId($insert_data);
+        return $ViolationStore_id;
+    }
+
+
+    /**
+     * 写入数据
+     * @author 唐远望
+     * @version 1.0
+     * @date 2025-12-15
+     * @param $data
+     * @return bool
+     */
+    public function addViolationStore($data)
+    {
+        DB::beginTransaction();
+        try {
+            $ViolationCompanyMemberModel = new ViolationCompanyMemberModel();
+            $insert_data = [
+                'company_name' => $data['company_name'],
+                'social_credit_code'    => $data['social_credit_code'],
+                'store_type'    => $data['store_type'],
+                'employee_ids'  => $data['employee_ids'],
+                'insert_time' => time(),
+            ];
+            $ViolationStore_id = $this->insertGetId($insert_data);
+
+            if ($data['employee_ids'] != '') {
+                $insert_company_data = [];
+                $employee_ids = explode(',', $data['employee_ids']);
+                foreach ($employee_ids as $employee_id) {
+                    $insert_company_data[] = [
+                        'company_logid' => $ViolationStore_id,
+                        'company_id' => $employee_id,
+                    ];
+                }
+                $ViolationCompanyMemberModel->insert($insert_company_data);
+            }
+            DB::commit();
+            return true;
+            // 成功处理...
+        } catch (\Exception $e) {
+            DB::rollBack();
+            // 错误处理...
+            return false;
+        }
+    }
+
+
+    /**
+     * 编辑内容
+     * @author 唐远望
+     * @version 1.0
+     * @date 2025-12-15
+     * @param $data
+     * @return bool
+     */
+    public function editViolationStore_content($where, $data)
+    {
+        $ViolationStore = $this->where($where)->first();
+        if (!$ViolationStore) {
+            return false;
+        }
+        $ViolationStore->company_name = $data['company_name'];
+        $ViolationStore->social_credit_code = $data['social_credit_code'];
+        $ViolationStore->store_type = $data['store_type'];
+        $ViolationStore->update_time = time();
+        $ViolationStore->save();
+        return true;
+    }
+
+
+
+    /**
+     * 更新数据
+     * @author 唐远望
+     * @version 1.0
+     * @date 2025-12-15
+     * @param $data
+     * @return bool
+     */
+    public function updateViolationStore($where, $data)
+    {
+        DB::beginTransaction();
+        try {
+            $ViolationCompanyMemberModel = new ViolationCompanyMemberModel();
+            $ViolationStore = $this->where($where)->first();
+            if (!$ViolationStore) {
+                return false;
+            }
+            $ViolationStore->company_name = $data['company_name'];
+            $ViolationStore->social_credit_code = $data['social_credit_code'];
+            $ViolationStore->store_type = $data['store_type'];
+            $ViolationStore->employee_ids = $data['employee_ids'];
+            $ViolationStore->update_time = time();
+            $ViolationStore->save();
+
+            $ViolationCompanyMemberModel->where('company_logid', $ViolationStore->id)->delete();
+            if ($data['employee_ids'] != '') {
+                $insert_company_data = [];
+                $employee_ids = explode(',', $data['employee_ids']);
+                foreach ($employee_ids as $employee_id) {
+                    $insert_company_data[] = [
+                        'company_logid' => $ViolationStore->id,
+                        'company_id' => $employee_id,
+                    ];
+                }
+                $ViolationCompanyMemberModel->insert($insert_company_data);
+            }
+            DB::commit();
+            return true;
+            // 成功处理...
+        } catch (\Exception $e) {
+            DB::rollBack();
+            // 错误处理...
+            return false;
+        }
+    }
+
+    /**
+     * 修改状态
+     * @author 唐远望
+     * @version 1.0
+     * @date 2025-12-15
+     * @param $id
+     * @param $status
+     * @return bool
+     */
+    public function changeStatus($where, $status)
+    {
+        $ViolationStore = $this->where($where)->first();
+        if (!$ViolationStore) {
+            return false;
+        }
+        $ViolationStore->status = $status;
+        $ViolationStore->update_time = time();
+        $ViolationStore->save();
+        return true;
+    }
+
+    /**
+     * 删除数据
+     * @author 唐远望
+     * @version 1.0
+     * @date 2025-12-15
+     * @param $id
+     * @return bool
+     */
+    public function deleteViolationStore($where)
+    {
+        $ViolationStore = $this->where($where)->first();
+        if (!$ViolationStore) {
+            return false;
+        }
+        $ViolationStore->delete();
+        return true;
+    }
+}

+ 14 - 1
routes/api.php

@@ -50,4 +50,17 @@ Route::any('process/violation_store/set_status', [App\Http\Controllers\Api\Proce
 Route::any('process/violation_store/set_processing_status', [App\Http\Controllers\Api\Process\ViolationStore::class, 'set_processing_status']);
 
 // 员工管理-列表
-Route::any('personnel_employee/list', [App\Http\Controllers\Api\Personnel\Employee::class, 'list']);
+Route::any('personnel_employee/list', [App\Http\Controllers\Api\Personnel\Employee::class, 'list']);
+
+// ------数据清洗配置------
+// 低价商品-列表
+Route::any('low_price_goods/list', [App\Http\Controllers\Api\WashConfig\LowPriceGoods::class, 'list']);
+
+// 强管控商品-列表
+Route::any('strong_control_goods/list', [App\Http\Controllers\Api\WashConfig\ControlGoods::class, 'list']);
+
+// 违规商品-列表
+Route::any('violation_goods/list', [App\Http\Controllers\Api\WashConfig\ViolationProduct::class, 'list']);
+
+// 违规店铺公司-列表
+Route::any('violation_store/list', [App\Http\Controllers\Api\WashConfig\ViolationStore::class, 'list']);