添加:权重值转赠记录
This commit is contained in:
parent
bbb78240f2
commit
9655c2f58d
|
|
@ -209,4 +209,18 @@ class TeamDividendLevelModel extends BackendModel
|
|||
'award_ratio' => 'required'
|
||||
];
|
||||
}
|
||||
/**
|
||||
* Common: 获取全部的等级信息
|
||||
* Author: wu-hui
|
||||
* Time: 2023/10/23 9:16
|
||||
* @param $field
|
||||
* @return mixed
|
||||
*/
|
||||
public static function getAll($field){
|
||||
return self::getList()->select($field)->get()->toArray();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -23,16 +23,12 @@ class IndexController extends BaseController{
|
|||
$pageSize = request()->input('page_size',10);
|
||||
$search = request()->input('search');
|
||||
// 获取列表信息
|
||||
$levelList = TeamDividendLevelModel::uniacid()
|
||||
->select(['id','level_name'])
|
||||
->get()
|
||||
->toArray();
|
||||
$result = WeightValue::getList($pageSize,$search);
|
||||
$data = [
|
||||
'list' => $result['data'],
|
||||
'pager' => PaginationHelper::show($result['total'],$result['current_page'],$result['per_page']),
|
||||
'search' => $search,
|
||||
'level_list' => $levelList
|
||||
'level_list' => TeamDividendLevelModel::getAll(['id','level_name'])
|
||||
];
|
||||
|
||||
return view('Yunshop\WeightValue::index.index',$data)->render();
|
||||
|
|
|
|||
|
|
@ -0,0 +1,39 @@
|
|||
<?php
|
||||
namespace Yunshop\WeightValue\admin;
|
||||
|
||||
use app\common\components\BaseController;
|
||||
use app\common\helpers\PaginationHelper;
|
||||
use Yunshop\TeamDividend\models\TeamDividendLevelModel;
|
||||
use Yunshop\WeightValue\models\WeightValueTransfer;
|
||||
|
||||
class TransferController extends BaseController{
|
||||
/**
|
||||
* Common: 转账记录
|
||||
* Author: wu-hui
|
||||
* Time: 2023/10/23 9:01
|
||||
* @return array|string
|
||||
* @throws \Throwable
|
||||
*/
|
||||
public function index(){
|
||||
//参数获取
|
||||
$pageSize = request()->input('page_size',10);
|
||||
$search = request()->input('search');
|
||||
// 获取列表信息
|
||||
$field = ['id','team_dividend_agency_level_id','member_id','transfer_member_id','transfer_num','receipt_num','service_charge','created_at'];
|
||||
$result = WeightValueTransfer::getList($pageSize,$search, $field);
|
||||
$data = [
|
||||
'list' => $result['data'],
|
||||
'pager' => PaginationHelper::show($result['total'],$result['current_page'],$result['per_page']),
|
||||
'search' => $search,
|
||||
'level_list' => TeamDividendLevelModel::getAll(['id','level_name'])
|
||||
];
|
||||
|
||||
|
||||
return view('Yunshop\WeightValue::transfer.index',$data)->render();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -3,16 +3,81 @@ namespace Yunshop\WeightValue\models;
|
|||
|
||||
|
||||
use app\common\models\BaseModel;
|
||||
|
||||
use app\common\models\Member;
|
||||
use Yunshop\TeamDividend\models\TeamDividendLevelModel;
|
||||
|
||||
class WeightValueTransfer extends BaseModel{
|
||||
|
||||
public $table = 'yz_weight_value_transfer';
|
||||
public $timestamps = false;
|
||||
public $casts = [
|
||||
'created_at' => 'datetime'
|
||||
];
|
||||
|
||||
|
||||
/**
|
||||
* Common: 获取转赠数量记录
|
||||
* Author: wu-hui
|
||||
* Time: 2023/10/23 9:01
|
||||
* @param $pageSize
|
||||
* @param $search
|
||||
* @param string[] $field
|
||||
* @return array
|
||||
*/
|
||||
public function getList($pageSize,$search,$field = ['*']){
|
||||
// 条件生成
|
||||
$where = [];
|
||||
if((int)$search['member_id'] > 0) $where[] = ['member_id','=',(int)$search['member_id']];
|
||||
if((int)$search['transfer_member_id'] > 0) $where[] = ['transfer_member_id','=',(int)$search['transfer_member_id']];
|
||||
if((int)$search['team_dividend_agency_level_id'] > 0) $where[] = ['team_dividend_agency_level_id','=',(int)$search['team_dividend_agency_level_id']];
|
||||
// 列表获取
|
||||
$list = self::uniacid()
|
||||
->select($field)
|
||||
->where($where)
|
||||
->with([
|
||||
'member' => function($query){
|
||||
$query->select(['uid','nickname','realname','avatar']);
|
||||
},
|
||||
'transferMember' => function($query){
|
||||
$query->select(['uid','nickname','realname','avatar']);
|
||||
},
|
||||
'level' => function($query){
|
||||
$query->select(['id','level_name']);
|
||||
},
|
||||
])
|
||||
->orderBy('created_at','DESC')
|
||||
->orderBy('id','DESC')
|
||||
->paginate($pageSize);
|
||||
|
||||
|
||||
return $list ? $list->toArray() : [];
|
||||
}
|
||||
/**
|
||||
* Common: 转赠用户 - 一对一关联
|
||||
* Author: wu-hui
|
||||
* Time: 2023/10/23 8:58
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasOne
|
||||
*/
|
||||
public function member(){
|
||||
return $this->hasOne(Member::class, 'uid', 'member_id');
|
||||
}
|
||||
/**
|
||||
* Common: 受让人用户信息 - 一对一关联
|
||||
* Author: wu-hui
|
||||
* Time: 2023/10/23 8:58
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasOne
|
||||
*/
|
||||
public function transferMember(){
|
||||
return $this->hasOne(Member::class, 'uid', 'transfer_member_id');
|
||||
}
|
||||
/**
|
||||
* Common: 一对一关联 经销商等级信息
|
||||
* Author: wu-hui
|
||||
* Time: 2023/10/23 9:10
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasOne
|
||||
*/
|
||||
public function level(){
|
||||
return $this->hasOne(TeamDividendLevelModel::class, 'id', 'team_dividend_agency_level_id');
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -49,6 +49,9 @@
|
|||
.level_4{
|
||||
background-color: #d9534f!important;
|
||||
}
|
||||
.panel-body .label{
|
||||
font-size: 14px!important;
|
||||
}
|
||||
</style>
|
||||
@section('content')
|
||||
<div class="w1200 m0a" id="terminalMerchantsIndex">
|
||||
|
|
|
|||
|
|
@ -0,0 +1,148 @@
|
|||
@extends('layouts.base')
|
||||
<style>
|
||||
.user{
|
||||
display: inline-flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: nowrap;
|
||||
align-items: center;
|
||||
justify-content: flex-start;
|
||||
overflow: hidden;
|
||||
height: 80px;
|
||||
}
|
||||
.user .user-avatar{
|
||||
height: 50px;
|
||||
width: 50px;
|
||||
margin-right: 5px;
|
||||
border-radius: 50%;
|
||||
overflow: hidden;
|
||||
}
|
||||
.user .user-avatar .avatar-image{
|
||||
width: 100% !important;
|
||||
height: 100% !important;
|
||||
}
|
||||
.user .user-info{
|
||||
height: 50px;
|
||||
text-align: left;
|
||||
}
|
||||
.user .user-info .user-nickname{
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
.user .user-info .user-status{
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
.panel-body .label{
|
||||
font-size: 14px!important;
|
||||
}
|
||||
</style>
|
||||
@section('content')
|
||||
<div class="w1200 m0a" id="terminalMerchantsIndex">
|
||||
{{--顶部搜索--}}
|
||||
<div class="panel panel-info">
|
||||
<div class="panel-body">
|
||||
<form action="" method="post" class="form-horizontal" role="form" id="form1">
|
||||
<div class="form-group">
|
||||
<div class="col-sm-11 col-xs-12">
|
||||
<div class="row row-fix tpl-category-container" >
|
||||
<div class="col-xs-12 col-sm-8 col-lg-3">
|
||||
<input class="form-control" name="search[member_id]" type="text" value="{{ $search['member_id'] }}" placeholder="转赠用户id">
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-8 col-lg-3">
|
||||
<input class="form-control" name="search[transfer_member_id]" type="text" value="{{ $search['transfer_member_id'] }}" placeholder="受让人用户id">
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-8 col-lg-3">
|
||||
<select class="form-control" name="search[team_dividend_agency_level_id]">
|
||||
<option value="0" @if (!$search['team_dividend_agency_level_id']) selected="selected" @endif>全部</option>
|
||||
@foreach($level_list as $levelItem)
|
||||
<option value="{{$levelItem['id']}}" @if ($search['team_dividend_agency_level_id'] == $levelItem['id']) selected="selected" @endif>
|
||||
{{$levelItem['level_name']}}
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-xs-12 col-sm-6 col-lg-6">
|
||||
<button class="btn btn-success" id="search"><i class="fa fa-search"></i> 搜索</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
{{--信息列表--}}
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-body" style="padding-top: 0;margin-bottom: 30px;overflow: auto;padding-right: 30px;">
|
||||
<table class="table" style="min-width:1500px;overflow: auto;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="text-align:center;width: 120px;">ID</th>
|
||||
<th style="text-align:left;">转赠用户</th>
|
||||
<th style="text-align:left;">受让人用户信息</th>
|
||||
<th style="text-align:center;">
|
||||
<span class="label label-default">转赠数量</span>
|
||||
<span class="label label-info">到账数量</span>
|
||||
<span class="label label-warning">手续费</span>
|
||||
</th>
|
||||
<th style="text-align:center;">权重值等级</th>
|
||||
<th style="text-align:center;">转赠时间</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($list as $item)
|
||||
<tr style="height: 50px;">
|
||||
<td style="text-align:center;">{{ $item['id'] }}</td>
|
||||
<td style="text-align:left;" >
|
||||
<div class="user">
|
||||
<div class="user-avatar">
|
||||
<img class="avatar-image" src="{{$item['member']['avatar_image']}}" />
|
||||
</div>
|
||||
<div class="user-info">
|
||||
<div class="user-nickname">昵称:{{ $item['member']['nickname'] }}</div>
|
||||
<div class="user-status">ID:{{ $item['member']['uid'] }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td style="text-align:left;">
|
||||
<div class="user">
|
||||
<div class="user-avatar">
|
||||
<img class="avatar-image" src="{{$item['transfer_member']['avatar_image']}}" />
|
||||
</div>
|
||||
<div class="user-info">
|
||||
<div class="user-nickname">昵称:{{ $item['transfer_member']['nickname'] }}</div>
|
||||
<div class="user-status">ID:{{ $item['transfer_member']['uid'] }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td style="text-align:center;">
|
||||
<span class="label label-default">{{ $item['transfer_num'] }}</span>
|
||||
<span class="label label-info">{{ $item['receipt_num'] }}</span>
|
||||
<span class="label label-warning">{{ $item['service_charge'] }}</span>
|
||||
</td>
|
||||
<td style="text-align:center;">{{ $item['level']['level_name'] }}</td>
|
||||
<td style="text-align:center;">{{ $item['created_at'] }}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
{!! $pager !!}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
// 查看销售信息统计
|
||||
function seeDetail(member_id,level_id){
|
||||
let link = "{{yzWebUrl('plugin.weight-value.admin.index.changeRecord')}}" + `&member_id=${member_id}&level_id=${level_id}`;
|
||||
let popup = util.ajaxshow(link,'权重值变更明细',{
|
||||
width: $(window).width() * 0.8 > 1200 ? $(window).width() * 0.8 : 1200,
|
||||
height: $(window).height() * 0.8 > 1200 ? $(window).height() * 0.8 : 1200,
|
||||
});
|
||||
}
|
||||
</script>
|
||||
@endsection
|
||||
|
||||
Loading…
Reference in New Issue