|
|
@@ -481,7 +481,49 @@ class UserBrokerageServices extends BaseServices
|
|
|
}
|
|
|
return ['list' => $list, 'time' => $times, 'count' => $count];
|
|
|
}
|
|
|
-
|
|
|
+ /**
|
|
|
+ * 获取资金列表
|
|
|
+ * @param array $where
|
|
|
+ * @param string $field
|
|
|
+ * @param int $limit
|
|
|
+ * @return array
|
|
|
+ */
|
|
|
+ public function getBrokerageListNew(array $where, string $field = '*', int $limit = 0)
|
|
|
+ {
|
|
|
+ $where_data = [];
|
|
|
+ if (isset($where['uid']) && $where['uid'] != '') {
|
|
|
+ $where_data['uid'] = $where['uid'];
|
|
|
+ }
|
|
|
+ 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'];
|
|
|
+ }
|
|
|
+ if ($limit) {
|
|
|
+ [$page] = $this->getPageValue();
|
|
|
+ } else {
|
|
|
+ [$page, $limit] = $this->getPageValue();
|
|
|
+ }
|
|
|
+ $data = $this->dao->getBrokerageList($where_data, $field, $page, $limit);
|
|
|
+ $count = $this->dao->count($where_data);
|
|
|
+ $data2 = $this->dao->getBrokerageList($where_data, $field);
|
|
|
+ $where_data['pm'] = 1;
|
|
|
+ $data3 = $this->dao->getBrokerageSumColumnNew($where_data);
|
|
|
+ $where_data['pm'] = 0;
|
|
|
+ $data4 = $this->dao->getBrokerageSumColumnNew($where_data);
|
|
|
+ $data5 = $data3 - $data4;
|
|
|
+ $sum = round($data5, 2);
|
|
|
+ foreach ($data as &$item) {
|
|
|
+ $item['nickname'] = $item['user']['nickname'] ?? '';
|
|
|
+ $item['_add_time'] = $item['add_time'] ? date('Y-m-d H:i:s', $item['add_time']) : '';
|
|
|
+ unset($item['user']);
|
|
|
+ }
|
|
|
+ return compact('data', 'count', 'sum');
|
|
|
+ }
|
|
|
/**
|
|
|
* 前端佣金排行页面数据
|
|
|
* @param int $uid
|