ReportToChannelUserAndOrderService.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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. return '';
  18. }
  19. public static function updateUserErrorRecord($id,$data){
  20. ReportToChannelUsers::where('id',$id)->update($data);
  21. }
  22. public static function updateOrderErrorRecord($id,$data){
  23. ReportToChannelOrders::where('id',$id)->update($data);
  24. }
  25. public static function getUserErrorRecord($date){
  26. return ReportToChannelUsers::where('report_status',0)
  27. ->where('created_at','>=',$date)
  28. ->select('id','uid','distribution_channel_id','register_ip','user_agent','user_created_at')
  29. ->get();
  30. }
  31. public static function getOrderErrorRecord($date){
  32. return ReportToChannelOrders::where('report_status',0)
  33. ->where('created_at','>=',$date)
  34. ->select('id','uid','distribution_channel_id','price','order_created_at')
  35. ->get();
  36. }
  37. }