| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- <?php
- namespace app\extra\service\store;
- use app\extra\basic\Service;
- use app\model\merchant\MerchantMemberLog;
- use app\model\merchant\MerchantMemberRecharge;
- class LogService extends Service
- {
- /**
- * 充值记录
- * @param array $param
- */
- public function getRechargeList(array $param = [])
- {
- $this->mode = new MerchantMemberRecharge();
- return $this->searchVal($param,$this->searchFilter($param))->append(['tel'])->withAttr(['tel' => function($data,$resp){
- return hide_mobile($resp['mobile']);
- }])->hidden(['mobile'])->paginate([
- "list_rows" => $param['pageSize'],
- "page" => $param['page']
- ]);
- }
- /**
- * 充值记录
- * @param array $param
- */
- public function getLogList(array $param = [])
- {
- $this->mode = new MerchantMemberLog();
- return $this->searchVal($param,$this->searchFilter($param))->append(['tel'])->withAttr(['tel' => function($data,$resp){
- return hide_mobile($resp['mobile']);
- }])->hidden(['mobile'])->paginate([
- "list_rows" => $param['pageSize'],
- "page" => $param['page']
- ]);
- }
- protected function searchFilter(array $param = []): array
- {
- $filter = [];
- !empty($param['agent']) && $filter[] = ["agent_id", '=', $param['agent']];
- !empty($param['store']) && $filter[] = ["store_id", '=', $param['store']];
- !empty($param['status']) && $filter[] = ["status", '=', $param['status']];
- !empty($param['type']) && $filter[] = ["type", '=', $param['type']];
- return $filter;
- }
- }
|