ReportToChannelUserAndOrderService.php 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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. if($distribution_channel_id == 10543){
  21. return 'http://yx1.hncwzx88.cn/api/app/home/wdy';
  22. }
  23. if($distribution_channel_id == 10588){
  24. return 'https://xdd.guozhen6.com/ysh/wdapi/';
  25. }
  26. return '';
  27. }
  28. public static function updateUserErrorRecord($id,$data){
  29. ReportToChannelUsers::where('id',$id)->update($data);
  30. }
  31. public static function updateOrderErrorRecord($id,$data){
  32. ReportToChannelOrders::where('id',$id)->update($data);
  33. }
  34. public static function getUserErrorRecord($date){
  35. return ReportToChannelUsers::where('report_status',0)
  36. ->where('created_at','>=',$date)
  37. ->select('id','uid','distribution_channel_id','register_ip','user_agent','user_created_at')
  38. ->get();
  39. }
  40. public static function getOrderErrorRecord($date){
  41. return ReportToChannelOrders::where('report_status',0)
  42. ->where('created_at','>=',$date)
  43. ->select('id','uid','distribution_channel_id','price','order_created_at')
  44. ->get();
  45. }
  46. }