LogService.php 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <?php
  2. namespace app\extra\service\store;
  3. use app\extra\basic\Service;
  4. use app\model\merchant\MerchantMemberLog;
  5. use app\model\merchant\MerchantMemberRecharge;
  6. class LogService extends Service
  7. {
  8. /**
  9. * 充值记录
  10. * @param array $param
  11. */
  12. public function getRechargeList(array $param = [])
  13. {
  14. $this->mode = new MerchantMemberRecharge();
  15. return $this->searchVal($param,$this->searchFilter($param))->append(['tel'])->withAttr(['tel' => function($data,$resp){
  16. return hide_mobile($resp['mobile']);
  17. }])->hidden(['mobile'])->paginate([
  18. "list_rows" => $param['pageSize'],
  19. "page" => $param['page']
  20. ]);
  21. }
  22. /**
  23. * 充值记录
  24. * @param array $param
  25. */
  26. public function getLogList(array $param = [])
  27. {
  28. $this->mode = new MerchantMemberLog();
  29. return $this->searchVal($param,$this->searchFilter($param))->append(['tel'])->withAttr(['tel' => function($data,$resp){
  30. return hide_mobile($resp['mobile']);
  31. }])->hidden(['mobile'])->paginate([
  32. "list_rows" => $param['pageSize'],
  33. "page" => $param['page']
  34. ]);
  35. }
  36. protected function searchFilter(array $param = []): array
  37. {
  38. $filter = [];
  39. !empty($param['agent']) && $filter[] = ["agent_id", '=', $param['agent']];
  40. !empty($param['store']) && $filter[] = ["store_id", '=', $param['store']];
  41. !empty($param['status']) && $filter[] = ["status", '=', $param['status']];
  42. !empty($param['type']) && $filter[] = ["type", '=', $param['type']];
  43. return $filter;
  44. }
  45. }