瀏覽代碼

[智价云] 违规处理通知开关

tangyuanwang 13 小時之前
父節點
當前提交
352090b46a

+ 11 - 0
app/Models/Manager/Process/LowPriceGoods.php

@@ -8,6 +8,7 @@ use Illuminate\Support\Facades\DB;
 use App\Models\Manager\Process\LowPriceGoodsMember as LowPriceGoodsMemberModel;
 use App\Facades\Servers\Logs\Log;
 use App\Models\Manager\Process\Notices as NoticesModel;
+use App\Models\Manager\Personnel\Employee as EmployeeModel;
 
 /**
  * 违规处理-低价商品模型
@@ -200,12 +201,16 @@ class LowPriceGoods extends Model
     {
         //添加通知
         $NoticesModel = new NoticesModel();
+        $EmployeeModel = new EmployeeModel();
         $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);
+            //查询已已经开启通知设置的用户
+            // $employee_ids = $EmployeeModel->whereIn('id', $all_persons)->where('open_notice', 0)->pluck('id')->toArray();
+            // if (count($employee_ids) == 0)  return true;
             foreach ($all_persons as $key => $employee_id) {
                 if ($employee_id == '' || is_null($employee_id))  continue;
                 $notices_data[] = [
@@ -220,6 +225,9 @@ class LowPriceGoods extends Model
             $NoticesModel->insert($notices_data);
         } else if ($low_price_data['first_responsible_person'] != '') {
             $first_responsible_persons = array_unique(explode(',', $low_price_data['first_responsible_person']));
+            //查询已已经开启通知设置的用户
+            // $employee_ids = $EmployeeModel->whereIn('id', $first_responsible_persons)->where('open_notice', 0)->pluck('id')->toArray();
+            // if (count($employee_ids) == 0)  return true;
             foreach ($first_responsible_persons as $key => $employee_id) {
                 if ($employee_id == '' || is_null($employee_id))  continue;
                 $notices_data[] = [
@@ -234,6 +242,9 @@ class LowPriceGoods extends Model
             $NoticesModel->insert($notices_data);
         } else if ($low_price_data['responsible_person'] != '') {
             $responsible_persons = array_unique(explode(',', $low_price_data['responsible_person']));
+            //查询已已经开启通知设置的用户
+            // $employee_ids = $EmployeeModel->whereIn('id', $responsible_persons)->where('open_notice', 0)->pluck('id')->toArray();
+            // if (count($employee_ids) == 0)  return true;
             foreach ($responsible_persons as $key => $employee_id) {
                 if ($employee_id == '' || is_null($employee_id))  continue;
                 $notices_data[] = [

+ 11 - 0
app/Models/Manager/Process/ViolationProduct.php

@@ -8,6 +8,7 @@ use Illuminate\Support\Facades\DB;
 use App\Models\Manager\Process\ViolationProductMember as ViolationProductMemberModel;
 use App\Facades\Servers\Logs\Log;
 use App\Models\Manager\Process\Notices as NoticesModel;
+use App\Models\Manager\Personnel\Employee as EmployeeModel;
 
 /**
  * 违规处理-违规商品模型
@@ -193,12 +194,16 @@ class ViolationProduct extends Model
     {
         //添加通知
         $NoticesModel = new NoticesModel();
+        $EmployeeModel = new EmployeeModel();
         $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);
+            //查询已已经开启通知设置的用户
+            // $employee_ids = $EmployeeModel->whereIn('id', $all_persons)->where('open_notice', 0)->pluck('id')->toArray();
+            // if (count($employee_ids) == 0)  return true;
             foreach ($all_persons as $key => $employee_id) {
                 if ($employee_id == '' || is_null($employee_id))  continue;
                 $notices_data[] = [
@@ -213,6 +218,9 @@ class ViolationProduct extends Model
             $NoticesModel->insert($notices_data);
         } else if ($low_price_data['first_responsible_person'] != '') {
             $first_responsible_persons = array_unique(explode(',', $low_price_data['first_responsible_person']));
+            //查询已已经开启通知设置的用户
+            // $employee_ids = $EmployeeModel->whereIn('id', $first_responsible_persons)->where('open_notice', 0)->pluck('id')->toArray();
+            // if (count($employee_ids) == 0)  return true;
             foreach ($first_responsible_persons as $key => $employee_id) {
                 if ($employee_id == '' || is_null($employee_id))  continue;
                 $notices_data[] = [
@@ -227,6 +235,9 @@ class ViolationProduct extends Model
             $NoticesModel->insert($notices_data);
         } else if ($low_price_data['responsible_person'] != '') {
             $responsible_persons = array_unique(explode(',', $low_price_data['responsible_person']));
+            //查询已已经开启通知设置的用户
+            // $employee_ids = $EmployeeModel->whereIn('id', $responsible_persons)->where('open_notice', 0)->pluck('id')->toArray();
+            // if (count($employee_ids) == 0)  return true;
             foreach ($responsible_persons as $key => $employee_id) {
                 if ($employee_id == '' || is_null($employee_id))  continue;
                 $notices_data[] = [

+ 11 - 0
app/Models/Manager/Process/ViolationStore.php

@@ -8,6 +8,7 @@ use Illuminate\Support\Facades\DB;
 use App\Models\Manager\Process\ViolationStoreMember as ViolationStoreMemberModel;
 use App\Facades\Servers\Logs\Log;
 use App\Models\Manager\Process\Notices as NoticesModel;
+use App\Models\Manager\Personnel\Employee as EmployeeModel;
 
 /**
  * 违规处理-违规店铺模型
@@ -165,12 +166,16 @@ class ViolationStore extends Model
     {
         //添加通知
         $NoticesModel = new NoticesModel();
+        $EmployeeModel = new EmployeeModel();
         $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);
+            //查询已已经开启通知设置的用户
+            // $employee_ids = $EmployeeModel->whereIn('id', $all_persons)->where('open_notice', 0)->pluck('id')->toArray();
+            // if (count($employee_ids) == 0)  return true;
             foreach ($all_persons as $key => $employee_id) {
                 if ($employee_id == '' || is_null($employee_id))  continue;
                 $notices_data[] = [
@@ -185,6 +190,9 @@ class ViolationStore extends Model
             $NoticesModel->insert($notices_data);
         } else if ($low_price_data['first_responsible_person'] != '') {
             $first_responsible_persons = array_unique(explode(',', $low_price_data['first_responsible_person']));
+            //查询已已经开启通知设置的用户
+            // $employee_ids = $EmployeeModel->whereIn('id', $first_responsible_persons)->where('open_notice', 0)->pluck('id')->toArray();
+            // if (count($employee_ids) == 0)  return true;
             foreach ($first_responsible_persons as $key => $employee_id) {
                 if ($employee_id == '' || is_null($employee_id))  continue;
                 $notices_data[] = [
@@ -199,6 +207,9 @@ class ViolationStore extends Model
             $NoticesModel->insert($notices_data);
         } else if ($low_price_data['responsible_person'] != '') {
             $responsible_persons = array_unique(explode(',', $low_price_data['responsible_person']));
+            //查询已已经开启通知设置的用户
+            // $employee_ids = $EmployeeModel->whereIn('id', $responsible_persons)->where('open_notice', 0)->pluck('id')->toArray();
+            // if (count($employee_ids) == 0)  return true;
             foreach ($responsible_persons as $key => $employee_id) {
                 if ($employee_id == '' || is_null($employee_id))  continue;
                 $notices_data[] = [