ReportToChannelUserAndOrderService.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: z-yang
  5. * Date: 2020/12/24
  6. * Time: 17:04
  7. */
  8. namespace App\Modules\Channel\Services;
  9. use App\Modules\Channel\Models\ReportToChannelOrders;
  10. use App\Modules\Channel\Models\ReportToChannelUsers;
  11. class ReportToChannelUserAndOrderService
  12. {
  13. public static $user_type = 'user';
  14. public static $order_type = 'order';
  15. const SUCCESS = 'success';
  16. public static function getReportUrl($distribution_channel_id,$type){
  17. if($distribution_channel_id == 10500){
  18. return 'https://sitewyn29mk4rrn53r7e.wd.pinyuew.com.cn/channelOrderAndUserReport';
  19. }
  20. return '';
  21. }
  22. public static function updateUserErrorRecord($id,$data){
  23. ReportToChannelUsers::where('id',$id)->update($data);
  24. }
  25. public static function updateOrderErrorRecord($id,$data){
  26. ReportToChannelOrders::where('id',$id)->update($data);
  27. }
  28. public static function getUserErrorRecord($date){
  29. return ReportToChannelUsers::where('report_status',0)
  30. ->where('created_at','>=',$date)
  31. ->select('id','uid','distribution_channel_id','register_ip','user_agent','user_created_at')
  32. ->get();
  33. }
  34. public static function getOrderErrorRecord($date){
  35. return ReportToChannelOrders::where('report_status',0)
  36. ->where('created_at','>=',$date)
  37. ->select('id','uid','distribution_channel_id','price','order_created_at')
  38. ->get();
  39. }
  40. }