diff --git a/app/common/repositories/user/UserAssetsLogRepository.php b/app/common/repositories/user/UserAssetsLogRepository.php index 239644a..aaf731a 100644 --- a/app/common/repositories/user/UserAssetsLogRepository.php +++ b/app/common/repositories/user/UserAssetsLogRepository.php @@ -527,6 +527,7 @@ class UserAssetsLogRepository extends BaseRepository { $query = $this->dao->search($uid, $where); $count = $query->count(); + $sql = $query->getLastSql(); $data = $query->page($page, $limit)->order('id desc')->select(); $list = array(); $changeType = $this->getChangeType(); diff --git a/app/common/repositories/user/UserAssetsRepository.php b/app/common/repositories/user/UserAssetsRepository.php index f3c9b78..85a7248 100644 --- a/app/common/repositories/user/UserAssetsRepository.php +++ b/app/common/repositories/user/UserAssetsRepository.php @@ -183,6 +183,7 @@ class UserAssetsRepository extends BaseRepository 'type' => UserAssetsLogRepository::STOCK, 'status' => UserAssetsLogRepository::STATUS_GET, 'count' => $stock, + 'ext' => array('diamond' => $config['diamondToStock'] * $count) ); app()->make(UserAssetsLogRepository::class)->addLog($logList); $this->dao->update($uid, array('diamond' => $assets['diamond'] + $diamond, 'stock' => $assets['stock'] + $stock)); @@ -190,7 +191,7 @@ class UserAssetsRepository extends BaseRepository /** - * notes 惠通宝转账 + * notes 积分转账 * @param $uid * @param $phone * @param $count @@ -255,7 +256,7 @@ class UserAssetsRepository extends BaseRepository /** - * notes 惠通宝转账 + * notes 钻石转账 * @param $uid * @param $phone * @param $count diff --git a/app/controller/admin/user/User.php b/app/controller/admin/user/User.php index a952494..4d8b6ec 100755 --- a/app/controller/admin/user/User.php +++ b/app/controller/admin/user/User.php @@ -15,6 +15,8 @@ namespace app\controller\admin\user; use app\common\repositories\store\ExcelRepository; +use app\common\repositories\user\UserAssetsLogRepository; +use app\common\repositories\user\UserAssetsRepository; use app\common\repositories\user\UserBrokerageRepository; use app\common\repositories\user\UserHistoryRepository; use app\common\repositories\user\UserSignRepository; @@ -103,6 +105,51 @@ class User extends BaseController return app('json')->success($this->repository->getList($where, $page, $limit)); } + public function assetsList(){ + $page = $this->request->param('page', 1); + $limit = $this->request->param('limit', 10); + $asset_type = $this->request->param('asset_type'); + $type = $this->request->param('type'); + $phone = $this->request->param('phone'); + $date = $this->request->param('date'); + + $userWhere = array(); + if($phone) $userWhere[] = array('phone','=',$phone); + $user = $this->repository->getWhere($userWhere); + + $where = array(); + if($asset_type)$where[] = array('asset_type','=',$asset_type); + if($type) $where[] = array('type','=',$type); + if($date){ + $date = explode('-', $date); + $where[] = array('create_time','between',[date('Y-m-d', strtotime($date[0])),date('Y-m-d', strtotime($date[1]) +86400)]); + } + if($user) $where[] = array('uid','=',$user['uid']); + return app('json')->success(app(UserAssetsLogRepository::class)->list(0, $where, $page, $limit)); + } + + public function stockList(){ + $page = $this->request->param('page', 1); + $limit = $this->request->param('limit', 10); + $asset_type = $this->request->param('asset_type'); + $phone = $this->request->param('phone'); + + $where = array(); + + if($phone){ + $userWhere = array(); + $userWhere[] = array('phone','=',$phone); + $user = $this->repository->getWhere($userWhere); + if($user) $where[] = array('uid','=',$user['uid']); + } + if($asset_type)$where[] = array('asset_type','=',$asset_type); + + $ret = app(UserAssetsLogRepository::class)->list(0, $where, $page, $limit); + $ret['stockTotal'] = app(UserAssetsRepository::class)->getSum('stock'); + + return app('json')->success($ret); + } + public function spreadList($uid) { $where = $this->request->params(['level', 'keyword', 'date']); diff --git a/app/controller/api/user/User.php b/app/controller/api/user/User.php index cce897d..610bf18 100755 --- a/app/controller/api/user/User.php +++ b/app/controller/api/user/User.php @@ -59,7 +59,6 @@ class User extends BaseController $where = array(); $where[] = array('asset_type','=',$asset_type); if($change_type) $where[] = array('type','=',$change_type); - $where[] = array('status','in',[UserAssetsLogRepository::STATUS_GET, UserAssetsLogRepository::STATUS_WITHDRAW, UserAssetsLogRepository::STATUS_USE]); return app('json')->success(app(UserAssetsLogRepository::class)->list($uid, $where, $page, $limit)); } diff --git a/route/admin/user.php b/route/admin/user.php index f3a4b60..1064711 100755 --- a/route/admin/user.php +++ b/route/admin/user.php @@ -99,6 +99,17 @@ Route::group(function () { Route::get('lst', '/lst')->name('systemUserLst')->option([ '_alias' => '用户列表', ]); + + //用户资产明细 + Route::get('assets_list', '/assetsList')->name('systemUserAssetsList')->option([ + '_alias' => '用户资产列表', + ]); + + //用户资产明细 + Route::get('stock_list', '/stockList')->name('systemUserStockList')->option([ + '_alias' => '用户资产列表', + ]); + Route::get('update/form/:id', '/updateForm')->name('systemUserUpdateForm')->option([ '_alias' => '用户编辑表单', '_auth' => false, diff --git a/view/admin/src/api/user.js b/view/admin/src/api/user.js index f75cde2..215387c 100644 --- a/view/admin/src/api/user.js +++ b/view/admin/src/api/user.js @@ -510,6 +510,6 @@ export function assetsLogList(data) { } // 惠通宝转让记录 -export function getHuitongbao(data) { - return request.get('user/huitong_list', data) +export function getStockList(data) { + return request.get('user/stock_list', data) } diff --git a/view/admin/src/views/user/assets/index.vue b/view/admin/src/views/user/assets/index.vue index 28c6669..38794ff 100644 --- a/view/admin/src/views/user/assets/index.vue +++ b/view/admin/src/views/user/assets/index.vue @@ -4,90 +4,81 @@
- - - + + + + + + + - - - 消费积分 - 分红点 - 福利积分 - 惠通宝 - 贡献值 - - + + + + + + + + + + + + + - + - 个人下单 - 签到 - 消费积分兑换分红点 - 分红点返佣 - 推广返佣 - 培育奖 - 区域代理奖 - 惠通宝兑换消费积分 - 转让他人 - 他人转让 + 积分 + 钻石 - - - - 搜索 - 导出 + + + + + + + + + + + + + + 搜索 +
- + - - - - - + + + + +
@@ -95,229 +86,80 @@ - - diff --git a/view/admin/src/views/user/stock/index.vue b/view/admin/src/views/user/stock/index.vue index 7511650..2002f5d 100644 --- a/view/admin/src/views/user/stock/index.vue +++ b/view/admin/src/views/user/stock/index.vue @@ -3,17 +3,18 @@ -
惠通宝当前市值:{{huitong}}
+
已兑换本票总数:{{totalStock}}
- - - + + + + + @@ -34,7 +35,7 @@