|
@@ -7,6 +7,7 @@ use Illuminate\Database\Eloquent\Model;
|
|
|
use Illuminate\Support\Facades\DB;
|
|
use Illuminate\Support\Facades\DB;
|
|
|
use App\Models\Manager\Process\ViolationProductMember as ViolationProductMemberModel;
|
|
use App\Models\Manager\Process\ViolationProductMember as ViolationProductMemberModel;
|
|
|
use App\Facades\Servers\Logs\Log;
|
|
use App\Facades\Servers\Logs\Log;
|
|
|
|
|
+use App\Models\manager\Process\Notices as NoticesModel;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 违规处理-违规商品模型
|
|
* 违规处理-违规商品模型
|
|
@@ -166,6 +167,8 @@ class ViolationProduct extends Model
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
$ViolationProductMemberModel->insert($source_responsible_person_data);
|
|
$ViolationProductMemberModel->insert($source_responsible_person_data);
|
|
|
|
|
+ //添加通知
|
|
|
|
|
+ $this->addNotices($insert_data, $ViolationProduct_id);
|
|
|
DB::commit();
|
|
DB::commit();
|
|
|
return true;
|
|
return true;
|
|
|
// 成功处理...
|
|
// 成功处理...
|
|
@@ -178,6 +181,66 @@ class ViolationProduct extends Model
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 处理通知消息
|
|
|
|
|
+ * @author 唐远望
|
|
|
|
|
+ * @version 1.0
|
|
|
|
|
+ * @date 2026-03-21
|
|
|
|
|
+ * @param $data
|
|
|
|
|
+ * @return bool
|
|
|
|
|
+ */
|
|
|
|
|
+ public function addNotices($low_price_data, $data_logid)
|
|
|
|
|
+ {
|
|
|
|
|
+ //添加通知
|
|
|
|
|
+ $NoticesModel = new NoticesModel();
|
|
|
|
|
+ $notices_data = [];
|
|
|
|
|
+ if ($low_price_data['first_responsible_person'] != '' && $low_price_data['responsible_person'] != '') {
|
|
|
|
|
+ //合并数据并去重
|
|
|
|
|
+ $first_responsible_persons = array_unique(explode(',', $low_price_data['first_responsible_person']));
|
|
|
|
|
+ $responsible_persons = array_unique(explode(',', $low_price_data['responsible_person']));
|
|
|
|
|
+ $all_persons = array_merge($first_responsible_persons, $responsible_persons);
|
|
|
|
|
+ foreach ($all_persons as $key => $employee_id) {
|
|
|
|
|
+ $notices_data[] = [
|
|
|
|
|
+ 'company_id' => $low_price_data['company_id'],
|
|
|
|
|
+ 'custom_uid' => $employee_id,
|
|
|
|
|
+ 'title' => '您有一条新的低价商品待处理,请及时查看。',
|
|
|
|
|
+ 'content_type' => '1', //内容类型1=低价挂网2=禁止挂网3=违规店铺
|
|
|
|
|
+ 'data_logid' => $data_logid,
|
|
|
|
|
+ 'insert_time' => time()
|
|
|
|
|
+ ];
|
|
|
|
|
+ }
|
|
|
|
|
+ $NoticesModel->insert($notices_data);
|
|
|
|
|
+ } else if ($low_price_data['first_responsible_person'] != '') {
|
|
|
|
|
+ $first_responsible_persons = array_unique(explode(',', $low_price_data['first_responsible_person']));
|
|
|
|
|
+ foreach ($first_responsible_persons as $key => $employee_id) {
|
|
|
|
|
+ $notices_data[] = [
|
|
|
|
|
+ 'company_id' => $low_price_data['company_id'],
|
|
|
|
|
+ 'custom_uid' => $employee_id,
|
|
|
|
|
+ 'title' => '您有一条新的低价商品待处理,请及时查看。',
|
|
|
|
|
+ 'content_type' => '1', //内容类型1=低价挂网2=禁止挂网3=违规店铺
|
|
|
|
|
+ 'data_logid' => $data_logid,
|
|
|
|
|
+ 'insert_time' => time()
|
|
|
|
|
+ ];
|
|
|
|
|
+ }
|
|
|
|
|
+ $NoticesModel->insert($notices_data);
|
|
|
|
|
+ } else if ($low_price_data['responsible_person'] != '') {
|
|
|
|
|
+ $responsible_persons = array_unique(explode(',', $low_price_data['responsible_person']));
|
|
|
|
|
+ foreach ($responsible_persons as $key => $employee_id) {
|
|
|
|
|
+ $notices_data[] = [
|
|
|
|
|
+ 'company_id' => $low_price_data['company_id'],
|
|
|
|
|
+ 'custom_uid' => $employee_id,
|
|
|
|
|
+ 'title' => '您有一条新的低价商品待处理,请及时查看。',
|
|
|
|
|
+ 'content_type' => '1', //内容类型1=低价挂网2=禁止挂网3=违规店铺
|
|
|
|
|
+ 'data_logid' => $data_logid,
|
|
|
|
|
+ 'insert_time' => time()
|
|
|
|
|
+ ];
|
|
|
|
|
+ }
|
|
|
|
|
+ $NoticesModel->insert($notices_data);
|
|
|
|
|
+ }
|
|
|
|
|
+ return true;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 编辑内容
|
|
* 编辑内容
|
|
|
* @author 唐远望
|
|
* @author 唐远望
|