Bladeren bron

Merge branch 'master' into 商品挂网统计

tangyuanwang 2 maanden geleden
bovenliggende
commit
4b79ba7da5

+ 5 - 3
app/Http/Controllers/Manager/Process/LowPriceGoods.php

@@ -45,6 +45,7 @@ class LowPriceGoods extends Controller
         $responsible_person = request('responsible_person', '');
         $platform = request('platform', '');
         $company_name = request('company_name', '');
+        $company_names = request('company_names', '');
         $store_name = request('store_name', '');
         $store_names = request('store_names', '');
         $source_responsible_person = request('source_responsible_person', '');
@@ -59,6 +60,7 @@ class LowPriceGoods extends Controller
         if ($product_name) $map[] = ['product_name', 'like', "%$product_name%"];
         if ($store_name) $map[]   = ['store_name', 'like', "%$store_name%"];
         if ($category_name) $map[] = ['category_name', 'like', "%$category_name%"];
+        if ($company_name) $map[] = ['company_name', 'like', "%$company_name%"];
 
         //多选平台查询
         if ($platform && is_string($platform)) {
@@ -96,9 +98,9 @@ class LowPriceGoods extends Controller
             $LowPriceGoodsModel = $LowPriceGoodsModel->whereIn('product_name', $product_names);
         }
         //多选公司查询
-        if ($company_name && is_string($company_name)) {
-            $company_name = explode(',', $company_name);
-            $LowPriceGoodsModel = $LowPriceGoodsModel->whereIn('company_name', $company_name);
+        if ($company_names && is_string($company_names)) {
+            $company_names = explode(',', $company_names);
+            $LowPriceGoodsModel = $LowPriceGoodsModel->whereIn('company_name', $company_names);
         }
         //多选第一责任人
         if ($first_responsible_person && is_string($first_responsible_person)) {

+ 5 - 3
app/Http/Controllers/Manager/Process/ViolationProduct.php

@@ -43,6 +43,7 @@ class ViolationProduct extends Controller
         $responsible_person = request('responsible_person', '');
         $platform = request('platform', '');
         $company_name = request('company_name', '');
+        $company_names = request('company_names', '');
         $store_name = request('store_name', '');
         $store_names = request('store_names', '');
         $source_responsible_person = request('source_responsible_person', '');
@@ -57,6 +58,7 @@ class ViolationProduct extends Controller
         if ($product_name) $map[] = ['product_name', 'like', "%$product_name%"];
         if ($store_name) $map[]   = ['store_name', 'like', "%$store_name%"];
         if ($category_name) $map[] = ['category_name', 'like', "%$category_name%"];
+        if ($company_name) $map[] = ['company_name', 'like', "%$company_name%"];
 
         //多选平台查询
         if ($platform && is_string($platform)) {
@@ -94,9 +96,9 @@ class ViolationProduct extends Controller
             $ViolationProductModel = $ViolationProductModel->whereIn('product_name', $product_names);
         }
         //多选公司查询
-        if ($company_name && is_string($company_name)) {
-            $company_name = explode(',', $company_name);
-            $ViolationProductModel = $ViolationProductModel->whereIn('company_name', $company_name);
+        if ($company_names && is_string($company_names)) {
+            $company_names = explode(',', $company_names);
+            $ViolationProductModel = $ViolationProductModel->whereIn('company_name', $company_names);
         }
         //多选第一责任人
         if ($first_responsible_person && is_string($first_responsible_person)) {

+ 5 - 3
app/Http/Controllers/Manager/Process/ViolationStore.php

@@ -40,6 +40,7 @@ class ViolationStore extends Controller
         $responsible_person = request('responsible_person', '');
         $platform = request('platform', '');
         $company_name = request('company_name', '');
+        $company_names = request('company_names', '');
         $store_name = request('store_name', '');
         $store_names = request('store_names', '');
         $source_responsible_person = request('source_responsible_person', '');
@@ -51,6 +52,7 @@ class ViolationStore extends Controller
         if ($end_time) $map[]   = ['insert_time', '<=', strtotime($end_time)];
         //其它条件
         if ($store_name) $map[]   = ['store_name', 'like', "%$store_name%"];
+        if ($company_name) $map[]   = ['company_name', 'like', "%$company_name%"];
 
         //多选平台查询
         if ($platform && is_string($platform)) {
@@ -83,9 +85,9 @@ class ViolationStore extends Controller
             $ViolationStoreModel = $ViolationStoreModel->whereIn('product_specs', $product_specs);
         }
         //多选公司查询
-        if ($company_name && is_string($company_name)) {
-            $company_name = explode(',', $company_name);
-            $ViolationStoreModel = $ViolationStoreModel->whereIn('company_name', $company_name);
+        if ($company_names && is_string($company_names)) {
+            $company_names = explode(',', $company_names);
+            $ViolationStoreModel = $ViolationStoreModel->whereIn('company_name', $company_names);
         }
         //多选第一责任人
         if ($first_responsible_person && is_string($first_responsible_person)) {

+ 0 - 14
app/Http/Controllers/Manager/WashConfig/ControlGoods.php

@@ -138,13 +138,6 @@ class ControlGoods extends Controller
         $all_data['category_id'] = $category_id;
         $specify_responsible_person = request('specify_responsible_person', '0');
         $all_data['specify_responsible_person'] = $specify_responsible_person;
-        //采集信息配置
-        $sampling_cycle = request('sampling_cycle', '0');
-        $sampling_start_time = request('sampling_start_time', '');
-        $sampling_end_time = request('sampling_end_time', '');
-        $all_data['sampling_cycle'] = $sampling_cycle;
-        $all_data['sampling_start_time'] = strtotime($sampling_start_time.'00:00:00');
-        $all_data['sampling_end_time'] = strtotime($sampling_end_time.'23:59:59');
         //查询是否存在
         $map = ['product_name' => $all_data['product_name'], 'product_specs' => $all_data['product_specs'], 'platform' => $all_data['platform']];
         $data = $ControlGoodsModel->where($map)->first();
@@ -179,13 +172,6 @@ class ControlGoods extends Controller
         $all_data['category_id'] = $category_id;
         $specify_responsible_person = request('specify_responsible_person', '0');
         $all_data['specify_responsible_person'] = $specify_responsible_person;
-        //采集信息配置
-        $sampling_cycle = request('sampling_cycle', '0');
-        $sampling_start_time = request('sampling_start_time', '');
-        $sampling_end_time = request('sampling_end_time', '');
-        $all_data['sampling_cycle'] = $sampling_cycle;
-        $all_data['sampling_start_time'] = strtotime($sampling_start_time.'00:00:00');
-        $all_data['sampling_end_time'] = strtotime($sampling_end_time.'23:59:59');
         //查询是否存在
         $map = ['product_name' => $all_data['product_name'], 'product_specs' => $all_data['product_specs'], 'platform' => $all_data['platform']];
         $data = $ControlGoodsModel->where($map)->where('id', '!=', $id)->first();

+ 0 - 21
app/Http/Controllers/Manager/WashConfig/LowPriceGoods.php

@@ -151,15 +151,6 @@ class LowPriceGoods extends Controller
         $all_data['category_id'] = $category_id;
         $specify_responsible_person = request('specify_responsible_person', '0');
         $all_data['specify_responsible_person'] = $specify_responsible_person;
-        //采集信息配置
-        $sampling_cycle = request('sampling_cycle', '0');
-        $sampling_start_time = request('sampling_start_time', '');
-        $sampling_end_time = request('sampling_end_time', '');
-        $all_data['sampling_cycle'] = $sampling_cycle;
-        $all_data['sampling_start_time'] = $sampling_start_time ? strtotime($sampling_start_time . '00:00:00'):'0';
-        $all_data['sampling_end_time'] = $sampling_end_time ? strtotime($sampling_end_time . '23:59:59'):'0';
-        $allow_sampling_time = Carbon::tomorrow()->startOfDay()->getTimestamp();// 明天的开始时间(允许开始采集时间校验)
-        if ($all_data['sampling_start_time'] && $all_data['sampling_start_time'] < $allow_sampling_time) return json_send(['code' => 'error', 'msg' => '采集最早开始时间为明天']);
         //查询是否存在
         $map = ['product_name' => $all_data['product_name'], 'product_specs' => $all_data['product_specs'], 'platform' => $all_data['platform']];
         $data = $LowPriceGoodsModel->where($map)->first();
@@ -199,13 +190,6 @@ class LowPriceGoods extends Controller
         $all_data['category_id'] = $category_id;
         $specify_responsible_person = request('specify_responsible_person', '0');
         $all_data['specify_responsible_person'] = $specify_responsible_person;
-        //采集信息配置
-        $sampling_cycle = request('sampling_cycle', '0');
-        $sampling_start_time = request('sampling_start_time', '');
-        $sampling_end_time = request('sampling_end_time', '');
-        $all_data['sampling_cycle'] = $sampling_cycle;
-        $all_data['sampling_start_time'] = $sampling_start_time ? strtotime($sampling_start_time . '00:00:00'):'0';
-        $all_data['sampling_end_time'] = $sampling_end_time ? strtotime($sampling_end_time . '23:59:59'):'0';
         //查询是否存在
         $map = ['product_name' => $all_data['product_name'], 'product_specs' => $all_data['product_specs'], 'platform' => $all_data['platform']];
         $data = $LowPriceGoodsModel->where($map)->where('id', '!=', $id)->first();
@@ -215,11 +199,6 @@ class LowPriceGoods extends Controller
         $LowProduct = $LowPriceGoodsModel->where($where)->first();
         if (!$LowProduct) return json_send(['code' => 'error', 'msg' => '记录不存在']);
         $oldData = $LowProduct->toarray();
-        //如果修改采集周期,则校验采集时间是否在明天以后
-        if ($sampling_cycle != $LowProduct->sampling_cycle) {
-            $allow_sampling_time = Carbon::tomorrow()->startOfDay()->getTimestamp(); // 明天的开始时间(允许开始采集时间校验)
-            if ($all_data['sampling_start_time'] && $all_data['sampling_start_time'] < $allow_sampling_time) return json_send(['code' => 'error', 'msg' => '采集最早开始时间为明天']);
-        }
         $result =  $LowPriceGoodsModel->editLowProduct_content($LowProduct, $all_data);
         // 如果操作失败
         if (!$result)     return json_send(['code' => 'error', 'msg' => '修改失败']);

+ 0 - 21
app/Http/Controllers/Manager/WashConfig/ViolationProduct.php

@@ -151,15 +151,6 @@ class ViolationProduct extends Controller
         $all_data['category_id'] = $category_id;
         $specify_responsible_person = request('specify_responsible_person', '0');
         $all_data['specify_responsible_person'] = $specify_responsible_person;
-        //采集信息配置
-        $sampling_cycle = request('sampling_cycle', '0');
-        $sampling_start_time = request('sampling_start_time', '');
-        $sampling_end_time = request('sampling_end_time', '');
-        $all_data['sampling_cycle'] = $sampling_cycle;
-        $all_data['sampling_start_time'] = $sampling_start_time ? strtotime($sampling_start_time . '00:00:00'):'0';
-        $all_data['sampling_end_time'] = $sampling_end_time ? strtotime($sampling_end_time . '23:59:59'):'0';
-        $allow_sampling_time = Carbon::tomorrow()->startOfDay()->getTimestamp();// 明天的开始时间(允许开始采集时间校验)
-        if ($all_data['sampling_start_time']  && $all_data['sampling_start_time'] < $allow_sampling_time) return json_send(['code' => 'error', 'msg' => '采集最早开始时间为明天']);
         //查询是否存在
         $map = ['product_name' => $all_data['product_name'], 'product_specs' => $all_data['product_specs'], 'platform' => $all_data['platform']];
         $data = $ViolationProductModel->where($map)->first();
@@ -199,13 +190,6 @@ class ViolationProduct extends Controller
         $all_data['category_id'] = $category_id;
         $specify_responsible_person = request('specify_responsible_person', '0');
         $all_data['specify_responsible_person'] = $specify_responsible_person;
-        //采集信息配置
-        $sampling_cycle = request('sampling_cycle', '0');
-        $sampling_start_time = request('sampling_start_time', '');
-        $sampling_end_time = request('sampling_end_time', '');
-        $all_data['sampling_cycle'] = $sampling_cycle;
-        $all_data['sampling_start_time'] = $sampling_start_time ? strtotime($sampling_start_time . '00:00:00'):'0';
-        $all_data['sampling_end_time'] = $sampling_end_time ? strtotime($sampling_end_time . '23:59:59'):'0';
         //查询是否存在
         $map = ['product_name' => $all_data['product_name'], 'product_specs' => $all_data['product_specs'], 'platform' => $all_data['platform']];
         $data = $ViolationProductModel->where($map)->where('id', '!=', $id)->first();
@@ -215,11 +199,6 @@ class ViolationProduct extends Controller
         $ViolationProduct = $ViolationProductModel->where($where)->first();
         if (!$ViolationProduct) return json_send(['code' => 'error', 'msg' => '记录不存在']);
         $oldData = $ViolationProduct->toarray();
-        //如果修改采集周期,则校验采集时间是否在明天以后
-        if ($sampling_cycle != $ViolationProduct->sampling_cycle) {
-            $allow_sampling_time = Carbon::tomorrow()->startOfDay()->getTimestamp(); // 明天的开始时间(允许开始采集时间校验)
-            if ($all_data['sampling_start_time']  && $all_data['sampling_start_time'] < $allow_sampling_time) return json_send(['code' => 'error', 'msg' => '采集最早开始时间为明天']);
-        }
         $result =  $ViolationProductModel->editViolationProduct_content($ViolationProduct, $all_data);
         // 如果操作失败
         if (!$result)     return json_send(['code' => 'error', 'msg' => '修改失败']);

+ 135 - 0
app/Models/Manager/Process/Notices.php

@@ -0,0 +1,135 @@
+<?php
+
+namespace App\Models\manager\Process;
+
+use Illuminate\Database\Eloquent\Factories\HasFactory;
+use Illuminate\Database\Eloquent\Model;
+use Illuminate\Support\Facades\DB;
+
+/**
+ * 通知消息模型
+ * @author: 唐远望
+ * @version: 1.0
+ * @date: 2025-12-29
+ */
+class Notices extends Model
+{
+    use HasFactory;
+    // 与模型关联的表名
+    protected $table = 'process_notices';
+    // 是否主动维护时间戳
+    public $timestamps = false;
+    // 定义时间戳字段名
+    // const CREATED_AT = 'insert_time';
+    // const UPDATED_AT = 'update_time';
+
+
+
+    /**
+     * 添加
+     * @author 唐远望
+     * @version 1.0
+     * @date 2025-12-29
+     */
+    public function addNotices_content($data)
+    {
+        $insert_data = [
+            'title' => $data['title'],
+            'content' => $data['content'],
+            'msg_type'    => $data['msg_type'],
+            'custom_uid' => $data['custom_uid'],
+        ];
+        $Notices_id = $this->insertGetId($insert_data);
+        return $Notices_id;
+    }
+
+
+    /**
+     * 写入数据
+     * @author 唐远望
+     * @version 1.0
+     * @date 2025-12-29
+     * @param $data
+     * @return bool
+     */
+    public function addNotices($data)
+    {
+        DB::beginTransaction();
+        try {
+            $this->addNotices_content($data);
+            DB::commit();
+            return true;
+            // 成功处理...
+        } catch (\Exception $e) {
+            DB::rollBack();
+            // 错误处理...
+            return false;
+        }
+    }
+
+
+    /**
+     * 编辑内容
+     * @author 唐远望
+     * @version 1.0
+     * @date 2025-12-29
+     * @param $data
+     * @return bool
+     */
+    public function editNotices_content($where, $data)
+    {
+        $Notices = $this->where($where)->first();
+        if (!$Notices) {
+            return false;
+        }
+        $Notices->title = $data['title'];
+        $Notices->content = $data['content'];
+        $Notices->msg_type = $data['msg_type'];
+        $Notices->custom_uid = $data['custom_uid'];
+        $Notices->save();
+        return true;
+    }
+
+
+
+    /**
+     * 更新数据
+     * @author 唐远望
+     * @version 1.0
+     * @date 2025-12-29
+     * @param $data
+     * @return bool
+     */
+    public function updateNotices($where, $data)
+    {
+        DB::beginTransaction();
+        try {
+            $this->editNotices_content($where, $data);
+            DB::commit();
+            return true;
+            // 成功处理...
+        } catch (\Exception $e) {
+            DB::rollBack();
+            // 错误处理...
+            return false;
+        }
+    }
+
+    /**
+     * 删除数据
+     * @author 唐远望
+     * @version 1.0
+     * @date 2025-12-29
+     * @param $id
+     * @return bool
+     */
+    public function deleteNotices($where)
+    {
+        $Notices = $this->where($where)->first();
+        if (!$Notices) {
+            return false;
+        }
+        $Notices->delete();
+        return true;
+    }
+}

+ 0 - 9
app/Models/Manager/WashConfig/ControlGoods.php

@@ -42,9 +42,6 @@ class ControlGoods extends Model
             'company_scope'    => $data['company_scope'] != '' ? 2 : 1, //公司范围1=全部公司 2=指定公司
             'category_id' => $data['category_id'],
             'specify_responsible_person' => $data['specify_responsible_person'],
-            'sampling_cycle' => $data['sampling_cycle'],
-            'sampling_start_time' => $data['sampling_start_time'],
-            'sampling_end_time' => $data['sampling_end_time'],
             'insert_time' => time(),
         ];
         $ControlGoods_id = $this->insertGetId($insert_data);
@@ -73,9 +70,6 @@ class ControlGoods extends Model
                 'company_scope'    => $data['company_scope'] != '' ? 2 : 1, //公司范围1=全部公司 2=指定公司
                 'category_id' => $data['category_id'],
                 'specify_responsible_person' => $data['specify_responsible_person'],
-                'sampling_cycle' => $data['sampling_cycle'],
-                'sampling_start_time' => $data['sampling_start_time'],
-                'sampling_end_time' => $data['sampling_end_time'],
                 'insert_time' => time(),
             ];
             $ControlGoods_id = $this->insertGetId($insert_data);
@@ -127,9 +121,6 @@ class ControlGoods extends Model
             $ControlGoods->company_scope = $company_scope;
             $ControlGoods->category_id = $data['category_id'];
             $ControlGoods->specify_responsible_person = $data['specify_responsible_person'];
-            $ControlGoods->sampling_cycle = $data['sampling_cycle'];
-            $ControlGoods->sampling_start_time = $data['sampling_start_time'];
-            $ControlGoods->sampling_end_time = $data['sampling_end_time'];
             $ControlGoods->update_time = time();
             $ControlGoods->save();
 

+ 0 - 9
app/Models/Manager/WashConfig/LowPriceGoods.php

@@ -43,9 +43,6 @@ class LowPriceGoods extends Model
             'company_scope'    => $data['company_scope'] != '' ? 2 : 1, //公司范围1=全部公司 2=指定公司
             'category_id' => $data['category_id'],
             'specify_responsible_person' => $data['specify_responsible_person'],
-            'sampling_cycle' => $data['sampling_cycle'],
-            'sampling_start_time' => $data['sampling_start_time'],
-            'sampling_end_time' => $data['sampling_end_time'],
             'insert_time' => time(),
         ];
         $LowProduct_id = $this->insertGetId($insert_data);
@@ -75,9 +72,6 @@ class LowPriceGoods extends Model
                 'company_scope'    => $data['company_scope'] != '' ? 2 : 1, //公司范围1=全部公司 2=指定公司
                 'category_id' => $data['category_id'],
                 'specify_responsible_person' => $data['specify_responsible_person'],
-                'sampling_cycle' => $data['sampling_cycle'],
-                'sampling_start_time' => $data['sampling_start_time'],
-                'sampling_end_time' => $data['sampling_end_time'],
                 'insert_time' => time(),
             ];
             $LowProduct_id = $this->insertGetId($insert_data);
@@ -127,9 +121,6 @@ class LowPriceGoods extends Model
             $LowProduct->company_scope = $company_scope;
             $LowProduct->category_id = $data['category_id'];
             $LowProduct->specify_responsible_person = $data['specify_responsible_person'];
-            $LowProduct->sampling_cycle = $data['sampling_cycle'];
-            $LowProduct->sampling_start_time = $data['sampling_start_time'];
-            $LowProduct->sampling_end_time = $data['sampling_end_time'];
             $LowProduct->update_time = time();
             $LowProduct->save();
 

+ 0 - 9
app/Models/Manager/WashConfig/ViolationProduct.php

@@ -42,9 +42,6 @@ class ViolationProduct extends Model
             'company_scope'    => $data['company_scope'] != '' ? 2 : 1, //公司范围1=全部公司 2=指定公司
             'category_id' => $data['category_id'],
             'specify_responsible_person' => $data['specify_responsible_person'],
-            'sampling_cycle' => $data['sampling_cycle'],
-            'sampling_start_time' => $data['sampling_start_time'],
-            'sampling_end_time' => $data['sampling_end_time'],
             'insert_time' => time(),
         ];
         $ViolationProduct_id = $this->insertGetId($insert_data);
@@ -73,9 +70,6 @@ class ViolationProduct extends Model
                 'company_scope'    => $data['company_scope'] != '' ? 2 : 1, //公司范围1=全部公司 2=指定公司
                 'category_id' => $data['category_id'],
                 'specify_responsible_person' => $data['specify_responsible_person'],
-                'sampling_cycle' => $data['sampling_cycle'],
-                'sampling_start_time' => $data['sampling_start_time'],
-                'sampling_end_time' => $data['sampling_end_time'],
                 'insert_time' => time(),
             ];
             $ViolationProduct_id = $this->insertGetId($insert_data);
@@ -123,9 +117,6 @@ class ViolationProduct extends Model
             $ViolationProduct->company_scope = $company_scope;
             $ViolationProduct->category_id = $data['category_id'];
             $ViolationProduct->specify_responsible_person = $data['specify_responsible_person'];
-            $ViolationProduct->sampling_cycle = $data['sampling_cycle'];
-            $ViolationProduct->sampling_start_time = $data['sampling_start_time'];
-            $ViolationProduct->sampling_end_time = $data['sampling_end_time'];
             $ViolationProduct->update_time = time();
             $ViolationProduct->save();