ReportToChannelUserAndOrderService.php 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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. if($distribution_channel_id == 10590){
  27. return 'https://xdd.guozhen6.com/ysh/wdapi/';
  28. }
  29. return '';
  30. }
  31. public static function updateUserErrorRecord($id,$data){
  32. ReportToChannelUsers::where('id',$id)->update($data);
  33. }
  34. public static function updateOrderErrorRecord($id,$data){
  35. ReportToChannelOrders::where('id',$id)->update($data);
  36. }
  37. public static function getUserErrorRecord($date){
  38. return ReportToChannelUsers::where('report_status',0)
  39. ->where('created_at','>=',$date)
  40. ->select('id','uid','distribution_channel_id','register_ip','user_agent','user_created_at')
  41. ->get();
  42. }
  43. public static function getOrderErrorRecord($date){
  44. return ReportToChannelOrders::where('report_status',0)
  45. ->where('created_at','>=',$date)
  46. ->select('id','uid','distribution_channel_id','price','order_created_at')
  47. ->get();
  48. }
  49. }