CollectData.php 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. <?php
  2. namespace App\Http\Controllers\Manager\Process;
  3. use App\Http\Controllers\Controller;
  4. use App\Models\Manager\External\Company as CompanyModel;
  5. use App\Jobs\Manager\CollectData\Backfill\LowPriceProductJobs;
  6. use App\Jobs\Manager\CollectData\Backfill\ViolationProductJobs;
  7. use App\Jobs\Manager\CollectData\Backfill\ViolationStoreJobs;
  8. /**
  9. * 清洗后的数据处理
  10. * @author 唐远望
  11. * @version 1.0
  12. * @date 2026-04-29
  13. */
  14. class CollectData extends Controller
  15. {
  16. /**
  17. * 低价商品数据数据清洗-回填责任人
  18. * @author: 唐远望
  19. * @version: 1.0
  20. * @date: 2026-05-22
  21. */
  22. public function low_price_product_collect_data()
  23. {
  24. try {
  25. $CompanyModel = new CompanyModel();
  26. $company_list = $CompanyModel->select(['id', 'status'])->where('id','5')->where('status', 0)->orderByDesc('cleaning_priority')->get()->toarray();
  27. foreach ($company_list as $company) {
  28. $message_data = ['company_id' => $company['id'], 'page' => '1', 'limit' => '50'];
  29. LowPriceProductJobs::dispatch($message_data);
  30. }
  31. return json_send(['code' => 'success', 'msg' => '执行成功', 'data' => '']);
  32. } catch (\Exception $e) {
  33. return json_send(['code' => 'error', 'msg' => '执行失败', 'data' => $e->getMessage()]);
  34. }
  35. }
  36. /**
  37. * 禁止商品清洗数据回填-回填责任人
  38. * @author: 唐远望
  39. * @version: 1.0
  40. * @date: 2026-05-22
  41. */
  42. public function violation_product_collect_data()
  43. {
  44. try {
  45. $CompanyModel = new CompanyModel();
  46. $company_list = $CompanyModel->select(['id', 'status'])->where('status', 0)->orderByDesc('cleaning_priority')->get()->toarray();
  47. foreach ($company_list as $company) {
  48. $message_data = ['company_id' => $company['id'], 'page' => '1', 'limit' => '10'];
  49. ViolationProductJobs::dispatch($message_data);
  50. }
  51. return json_send(['code' => 'success', 'msg' => '执行成功', 'data' => '']);
  52. } catch (\Exception $e) {
  53. return json_send(['code' => 'error', 'msg' => '执行失败', 'data' => $e->getMessage()]);
  54. }
  55. }
  56. /**
  57. * 违规店铺清洗数据回填-回填责任人
  58. * @author: 唐远望
  59. * @version: 1.0
  60. * @date: 2026-05-22
  61. */
  62. public function violation_store_collect_data()
  63. {
  64. try {
  65. $CompanyModel = new CompanyModel();
  66. $company_list = $CompanyModel->select(['id', 'status'])->where('status', 0)->orderByDesc('cleaning_priority')->get()->toarray();
  67. foreach ($company_list as $company) {
  68. $message_data = ['company_id' => $company['id'], 'page' => '1', 'limit' => '10'];
  69. ViolationStoreJobs::dispatch($message_data);
  70. }
  71. return json_send(['code' => 'success', 'msg' => '执行成功', 'data' => '']);
  72. } catch (\Exception $e) {
  73. return json_send(['code' => 'error', 'msg' => '执行失败', 'data' => $e->getMessage()]);
  74. }
  75. }
  76. }