|
|
@@ -61,8 +61,14 @@ class UserBill extends BaseModel
|
|
|
*/
|
|
|
public static function userBillList($uid, $page, $limit, $category = 'integral', $where = [])
|
|
|
{
|
|
|
+ $model = new self;
|
|
|
+ if ($where['date'] != '') {
|
|
|
+ list($startTime, $endTime) = explode(' - ', $where['date']);
|
|
|
+ $model = $model->where('a.add_time', '>', strtotime($startTime));
|
|
|
+ $model = $model->where('a.add_time', '<', (int)bcadd(strtotime($endTime), 86400, 0));
|
|
|
+ }
|
|
|
if ($page) {
|
|
|
- $list = self::where('uid', $uid)
|
|
|
+ $list = $model->where('uid', $uid)
|
|
|
->where('category', $category)
|
|
|
->field('mark,pm,number,add_time')
|
|
|
->where('status', 1)
|
|
|
@@ -71,7 +77,7 @@ class UserBill extends BaseModel
|
|
|
->page((int)$page, (int)$limit)
|
|
|
->select();
|
|
|
} else {
|
|
|
- $list = self::where('uid', $uid)
|
|
|
+ $list = $model->where('uid', $uid)
|
|
|
->where('category', $category)
|
|
|
->field('mark,pm,number,add_time')
|
|
|
->where('status', 1)
|
|
|
@@ -79,6 +85,7 @@ class UserBill extends BaseModel
|
|
|
->order('add_time DESC')
|
|
|
->select();
|
|
|
}
|
|
|
+
|
|
|
$list = count($list) ? $list->toArray() : [];
|
|
|
foreach ($list as &$v) {
|
|
|
$v['add_time'] = date('Y/m/d H:i', $v['add_time']);
|
|
|
@@ -148,11 +155,16 @@ class UserBill extends BaseModel
|
|
|
* @param int $type 展示类型
|
|
|
* @return array
|
|
|
* */
|
|
|
- public static function getUserBillList($uid, $page, $limit, $type)
|
|
|
+ public static function getUserBillList($uid, $page, $limit, $type,$where=[])
|
|
|
{
|
|
|
if (!$limit) return [];
|
|
|
$model = self::where('uid', $uid)->order('add_time desc')->where('number', '<>', 0)
|
|
|
->field('FROM_UNIXTIME(add_time,"%Y-%m") as time,group_concat(id SEPARATOR ",") ids')->group('time');
|
|
|
+ if ($where['date'] != '') {
|
|
|
+ list($startTime, $endTime) = explode(' - ', $where['date']);
|
|
|
+ $model = $model->where('a.add_time', '>', strtotime($startTime));
|
|
|
+ $model = $model->where('a.add_time', '<', (int)bcadd(strtotime($endTime), 86400, 0));
|
|
|
+ }
|
|
|
switch ((int)$type) {
|
|
|
case 1:
|
|
|
$model = $model->where('category', 'now_money')->where('pm', 0);
|