|
|
@@ -13,6 +13,7 @@ namespace app\services\user;
|
|
|
|
|
|
use app\dao\system\config\SystemConfigDao;
|
|
|
use app\dao\user\UserBrokerageDao;
|
|
|
+use app\dao\user\UserGiftQuotaDao;
|
|
|
use app\services\BaseServices;
|
|
|
use crmeb\exceptions\ApiException;
|
|
|
|
|
|
@@ -693,4 +694,48 @@ class UserBrokerageServices extends BaseServices
|
|
|
return '转账成功';
|
|
|
});
|
|
|
}
|
|
|
+ /**
|
|
|
+ * 获取佣金记录列表(完整版,包含user信息)
|
|
|
+ * @param array $where
|
|
|
+ * @param string $field
|
|
|
+ * @return array
|
|
|
+ */
|
|
|
+ public function getGiftQuota(array $where, string $field = '*')
|
|
|
+ {
|
|
|
+ /** @var UserGiftQuotaServices $UserGiftQuotaServices */
|
|
|
+ $UserGiftQuotaServices = app()->make(UserGiftQuotaServices::class);
|
|
|
+ $where_data = [];
|
|
|
+ if (isset($where['uid']) && $where['uid'] != '') {
|
|
|
+ $where_data['uid'] = $where['uid'];
|
|
|
+ }
|
|
|
+ if (isset($where['pm']) && $where['pm'] != '') {
|
|
|
+ $where_data['pm'] = $where['pm'];
|
|
|
+ }
|
|
|
+ if ($where['start_time'] != '' && $where['end_time'] != '') {
|
|
|
+ $where_data['time'] = str_replace('-', '/', $where['start_time']) . ' - ' . str_replace('-', '/', $where['end_time']);
|
|
|
+ }
|
|
|
+ if (isset($where['type']) && $where['type'] != '') {
|
|
|
+ $where_data['type'] = $where['type'];
|
|
|
+ }
|
|
|
+ if (isset($where['nickname']) && $where['nickname'] != '') {
|
|
|
+ $where_data['like'] = $where['nickname'];
|
|
|
+ }
|
|
|
+
|
|
|
+ [$page, $limit] = $UserGiftQuotaServices->getPageValue();
|
|
|
+ /** @var UserGiftQuotaDao $UserGiftQuotaDao */
|
|
|
+ $UserGiftQuotaDao = app()->make(UserGiftQuotaDao::class);
|
|
|
+ // 按时间从大到小排列
|
|
|
+ $data = $UserGiftQuotaDao->getGiftQuotaListByTime($where_data, $field, $page, $limit);
|
|
|
+ $count = $UserGiftQuotaDao->count($where_data);
|
|
|
+
|
|
|
+ foreach ($data as &$item) {
|
|
|
+ $item['nickname'] = $item['user']['nickname'] ?? '';
|
|
|
+ $item['phone'] = $item['user']['phone'] ?? '';
|
|
|
+ $item['avatar'] = $item['user']['avatar'] ?? '';
|
|
|
+ $item['_add_time'] = $item['add_time'] ? date('Y-m-d H:i:s', $item['add_time']) : '';
|
|
|
+ unset($item['user']);
|
|
|
+ }
|
|
|
+
|
|
|
+ return compact('data', 'count');
|
|
|
+ }
|
|
|
}
|