转让列表

main
home.fengxinyhyl 9 months ago
parent 6ed285e231
commit ab1c729032
  1. 1
      app/common/repositories/user/UserAssetsLogRepository.php
  2. 5
      app/common/repositories/user/UserAssetsRepository.php
  3. 47
      app/controller/admin/user/User.php
  4. 1
      app/controller/api/user/User.php
  5. 11
      route/admin/user.php
  6. 4
      view/admin/src/api/user.js
  7. 378
      view/admin/src/views/user/assets/index.vue
  8. 34
      view/admin/src/views/user/stock/index.vue

@ -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();

@ -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

@ -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']);

@ -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));
}

@ -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,

@ -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)
}

@ -4,90 +4,81 @@
<div slot="header" class="clearfix">
<div class="container">
<el-form size="small" inline label-width="100px">
<el-form-item label="昵称:">
<el-input
style="width: 200px"
placeholder="请输入昵称"
v-model="tableFrom.nickname"
/>
</el-form-item>
<!-- <el-form-item label="昵称:">-->
<!-- <el-input-->
<!-- style="width: 200px"-->
<!-- placeholder="请输入昵称"-->
<!-- v-model="tableFrom.nickname"-->
<!-- />-->
<!-- </el-form-item>-->
<el-form-item label="手机号:">
<el-input
style="width: 200px"
placeholder="请输入手机号"
v-model="tableFrom.phone"
v-model="phone"
/>
</el-form-item>
<el-form-item label="货币类型:" clearable>
<el-select
v-model="tableFrom.asset_type"
placeholder="请选择货币类型"
clearable
>
<el-option value="1" label="消费积分">消费积分</el-option>
<el-option value="2" label="分红点">分红点</el-option>
<el-option value="3" label="福利积分">福利积分</el-option>
<el-option value="4" label="惠通宝">惠通宝</el-option>
<el-option value="5" label="贡献值">贡献值</el-option>
</el-select>
</el-form-item>
<!-- <el-form-item label="货币类型:" clearable>-->
<!-- <el-select-->
<!-- v-model="tableFrom.asset_type"-->
<!-- placeholder="请选择货币类型"-->
<!-- clearable-->
<!-- >-->
<!-- <el-option value="1" label="消费积分">消费积分</el-option>-->
<!-- <el-option value="2" label="分红点">分红点</el-option>-->
<!-- <el-option value="3" label="福利积分">福利积分</el-option>-->
<!-- <el-option value="4" label="惠通宝">惠通宝</el-option>-->
<!-- <el-option value="5" label="贡献值">贡献值</el-option>-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<el-form-item label="分值来源:">
<el-form-item label="转让类型:">
<el-select
placeholder="请选择"
v-model="tableFrom.type"
clearable
v-model="type"
>
<el-option value="1" label="个人下单">个人下单</el-option>
<el-option value="2" label="签到">签到</el-option>
<el-option value="3" label="消费积分兑换分红点">消费积分兑换分红点</el-option>
<el-option value="4" label="分红点返佣">分红点返佣</el-option>
<el-option value="5" label="推广返佣">推广返佣</el-option>
<el-option value="6" label="培育奖">培育奖</el-option>
<el-option value="7" label="区域代理奖">区域代理奖</el-option>
<el-option value="8" label="惠通宝兑换消费积分">惠通宝兑换消费积分</el-option>
<el-option value="9" label="转让他人">转让他人</el-option>
<el-option value="10" label="他人转让">他人转让</el-option>
<el-option value="6" label="积分" aria-checked="true">积分</el-option>
<el-option value="20" label="钻石">钻石</el-option>
</el-select>
</el-form-item>
<el-form-item label="时间选择:" class="width100">
<el-date-picker
v-model="timeVal"
value-format="yyyy/MM/dd"
format="yyyy/MM/dd"
size="small"
type="daterange"
placement="bottom-end"
placeholder="自定义时间"
style="width: 250px;"
@change="onchangeTime"
/>
</el-form-item>
<el-button size="small" type="primary" icon="el-icon-search" @click="getList()">搜索</el-button>
<el-button size="small" type="primary" @click="exportTableToExcel('table', 'exported-data')">导出</el-button>
<!-- <el-form-item label="时间选择:" class="width100">-->
<!-- <el-date-picker-->
<!-- v-model="timeVal"-->
<!-- value-format="yyyy/MM/dd"-->
<!-- format="yyyy/MM/dd"-->
<!-- size="small"-->
<!-- type="daterange"-->
<!-- placement="bottom-end"-->
<!-- placeholder="自定义时间"-->
<!-- style="width: 250px;"-->
<!-- @change="onchangeTime"-->
<!-- />-->
<!-- </el-form-item>-->
<el-button size="small" type="primary" icon="el-icon-search" @click="getStockHandle()">搜索</el-button>
<!-- <el-button size="small" type="primary" @click="exportTableToExcel('table', 'exported-data')">导出</el-button>-->
</el-form>
</div>
</div>
<el-table v-loading="loading" :data="tableData.data" style="width: 100%" size="small" id="table">
<el-table :data="tableData" style="width: 100%" size="small" id="table">
<el-table-column label="ID" prop="id" min-width="80"/>
<el-table-column label="用户昵称" prop="user_nickname" min-width="120"/>
<el-table-column label="手机" prop="user_phone" min-width="120"/>
<el-table-column label="货币类型" prop="asset_type" min-width="120"/>
<el-table-column label="分值来源" prop="type" min-width="120"/>
<el-table-column label="变动情况" prop="count" min-width="120"/>
<el-table-column label="转让类型" prop="asset_type" min-width="120"/>
<el-table-column label="转让账户" prop="user_phone" min-width="120"/>
<el-table-column label="收款账户" prop="ext.to_phone" min-width="120"/>
<el-table-column label="转让数量" prop="count" min-width="120"/>
<el-table-column label="手续费" prop="fee" min-width="120"/>
<el-table-column label="变动时间" prop="create_time" min-width="120" />
</el-table>
<div class="block">
<el-pagination
:page-sizes="[20, 40, 60, 80]"
:page-size="tableFrom.limit"
:current-page="tableFrom.page"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="tableData.total"
@size-change="handleSizeChange"
@current-change="pageChange"
@current-change="handleCurrentChange"
/>
</div>
</el-card>
@ -95,229 +86,80 @@
</template>
<script>
import { mapState } from "vuex";
import {discountsList, discountsChangeStatus, discountsGetDetails, assetsLogList} from "@/api/marketing";
import { formatDate } from "@/utils/validate";
import { roterPre } from '@/settings'
import { saveAs } from 'file-saver';
import * as XLSX from 'xlsx';
// +----------------------------------------------------------------------
// | CRMEB [ CRMEB ]
// +----------------------------------------------------------------------
// | Copyright (c) 2016~2021 https://www.crmeb.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed CRMEBCRMEB
// +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com>
// +----------------------------------------------------------------------
import {assetsLogList} from '@/api/user'
export default {
name: "Discounts",
filters: {
formatDate(time) {
if (time !== 0) {
let date = new Date(time * 1000);
return formatDate(date, "yyyy-MM-dd hh:mm");
}
},
},
data() {
return {
loading: false,
dialogLoading: false,
roterPre: roterPre,
dialogVisible: false,
tableData: {
data: [],
total: 0,
},
tableFrom: {
type: "",
nickname: "",
phone: "",
page: 1,
asset_type: "",
limit: 20,
},
specsMainData: [],
specsData: [],
timeVal: [],
formValidate: {
title: "", //
type: 0, //
image: "", //
is_time: 0, //
is_limit: 0, //1/0
limit_num: 0, //
link_ids: [], //
time: [], //
sort: 0, //
free_shipping: 1, //
status: 1,
products: [],
},
};
phone:'',
tableData:[],
pageIndex:1,
pageSize:10,
total:0,
type:'积分',
}
},
computed: {
},
created() {
this.getList('');
mounted() {
this.getStockHandle()
},
methods: {
exportTableToExcel(tableId, fileName) {
/* 获取表格数据 */
const ws = XLSX.utils.table_to_sheet(document.getElementById(tableId));
/* 新建工作簿并添加工作表 */
const wb = XLSX.utils.book_new();
XLSX.utils.book_append_sheet(wb, ws, "Sheet1");
/* 生成Excel文件 */
const wbout = XLSX.write(wb, { bookType: 'xlsx', type: 'binary' });
/* 字符串转ArrayBuffer */
function s2ab(s) {
const buf = new ArrayBuffer(s.length);
const view = new Uint8Array(buf);
for (let i = 0; i !== s.length; ++i) view[i] = s.charCodeAt(i) & 0xFF;
return buf;
}
/* 保存文件 */
saveAs(new Blob([s2ab(wbout)], { type: 'application/octet-stream' }), fileName + '.xlsx');
},
//
handleDetail(id) {
this.dialogVisible = true;
this.dialogLoading = true;
discountsGetDetails(id).then((res) => {
this.formValidate = res.data;
this.formValidate.time = res.data.time || [];
this.dialogLoading = false;
for (let i = 0; i < res.data.discountsProduct.length; i++) {
const element = res.data.discountsProduct[i];
element.attr= [];
const attrArr = element['product'] && element['product']['attrValue'] || [];
for (let j = 0; j < attrArr.length; j++) {
const attr = attrArr[j];
if (attr.productSku) {
element.attr.push(attr)
}
}
if (element.type == 1) {
this.specsMainData.push(element);
} else {
this.specsData.push(element);
}
}
});
handleCurrentChange(val){
this.pageIndex = val;
this.getStockHandle()
},
//
getList(num) {
this.loading = true;
this.tableFrom.page = num ? num : this.tableFrom.page;
assetsLogList(this.tableFrom)
.then(async (res) => {
this.tableData.data = res.data.list;
this.tableData.total = res.data.count;
this.loading = false;
})
.catch((res) => {
this.loading = false;
this.$message.error(res.message);
});
},
pageChange(page) {
this.tableFrom.page = page;
this.getList('');
},
handleSizeChange(val) {
this.tableFrom.limit = val;
this.getList('');
handleSizeChange(val){
this.pageSize = val;
this.getStockHandle()
},
//
onchangeTime(e) {
this.timeVal = e;
this.tableFrom.date = this.timeVal ? this.timeVal.join("-") : "";
},
//
onchangeIsShow(row) {
discountsChangeStatus(row.discount_id,row.status)
.then(async (res) => {
this.$message.success(res.message);
this.getList('');
})
.catch((res) => {
this.$message.error(res.message);
this.getList('');
});
},
},
};
</script>
<style scoped lang="scss">
.tabBox_img {
width: 36px;
height: 36px;
border-radius: 4px;
cursor: pointer;
img {
width: 100%;
height: 100%;
getStockHandle(){
let postType = this.type
if(this.type === '积分'){
postType = 6
}
let params = {
page:this.pageIndex,
limit:this.pageSize,
phone:this.phone,
type:postType,
}
assetsLogList(params).then(res=>{
this.tableData = res.data.list;
this.total = res.data.count;
})
}
}
}
.box-container {
overflow: hidden;
}
.box-container .list {
float: left;
line-height: 40px;
</script>
}
.box-container .sp {
width: 50%;
//white-space: nowrap;
//overflow: hidden;
//text-overflow: ellipsis;
}
.box-container .sp3 {
width: 33.3333%;
}
.box-container .sp100 {
width: 100%;
}
.box-container .list .name {
display: inline-block;
color: #606266;
}
.box-container .list .blue {
color: #1890ff;
}
.box-container .list.image {
margin: 20px 0;
position: relative;
}
.box-container .list.image img {
position: absolute;
top: -20px;
}
.labeltop{
max-height: 280px;
min-height: 120px;
overflow-y: auto;
}
.title{
margin-bottom: 16px;
color: #17233d;
font-size: 14px;
font-weight: bold;
padding-bottom: 2px;
border-bottom: 1px solid #dfe6ec;
}
.product-data {
<style lang="scss" scoped>
.search{
display: flex;
align-items: center;
.image {
width: 50px !important;
height: 50px !important;
margin-right: 10px;
.input{
display: flex;
align-items: center;
span{
display:inline-block;
width:200px;
}
}
}
.info{
font-size: 18px;
font-weight: bold;
margin:10px 0;
}
</style>

@ -3,17 +3,18 @@
<el-card class="box-card">
<div class="search">
<div class="input">
<span>赠送方手机号</span>
<span>用户手机号</span>
<el-input v-model="account"></el-input>
</div>
<el-button size="small" style="margin-left:20px;" type="primary">查询</el-button>
<el-button size="small" type="info">重置</el-button>
<el-button size="small" style="margin-left:20px;" type="primary" @click="getStockHandle()">查询</el-button>
</div>
<div class="info">惠通宝当前市值{{huitong}}</div>
<div class="info">已兑换本票总数{{totalStock}}</div>
<el-table :data="tableData" style="width: 100%;">
<el-table-column prop="user_phone" label="转让账户"></el-table-column>
<el-table-column prop="to_phone" label="收款账户"></el-table-column>
<el-table-column prop="count" label="转让数量"></el-table-column>
<el-table-column prop="id" label="ID"></el-table-column>
<el-table-column prop="user_nickname" label="用户昵称"></el-table-column>
<el-table-column prop="user_phone" label="用户手机号"></el-table-column>
<el-table-column prop="ext.diamond" label="钻石兑换数"></el-table-column>
<el-table-column prop="count" label="兑换本票数"></el-table-column>
<el-table-column prop="create_time" label="转让时间"></el-table-column>
</el-table>
@ -34,7 +35,7 @@
</template>
<script>
import {getHuitongbao} from '@/api/user'
import {getStockList} from '@/api/user'
// +----------------------------------------------------------------------
// | CRMEB [ CRMEB ]
// +----------------------------------------------------------------------
@ -58,32 +59,33 @@
pageIndex:1,
pageSize:10,
total:0,
huitong:0,
totalStock:0,
}
},
mounted() {
this.getHuitongbaoHandle()
this.getStockHandle()
},
methods: {
handleCurrentChange(val){
this.pageIndex = val;
this.getHuitongbaoHandle()
this.getStockHandle()
},
handleSizeChange(val){
this.pageSize = val;
this.getHuitongbaoHandle()
this.getStockHandle()
},
getHuitongbaoHandle(){
getStockHandle(){
let params = {
page:this.pageIndex,
limit:this.pageSize,
phone:this.account
phone:this.account,
asset_type:3,
}
getHuitongbao(params).then(res=>{
getStockList(params).then(res=>{
console.log(res,"99")
this.tableData = res.data.list;
this.total = res.data.count;
this.huitong = res.data.huitong
this.totalStock = res.data.stockTotal
})
}
}

Loading…
Cancel
Save