添加:权重值插件 - 权重值明细管理
This commit is contained in:
parent
988d9740a5
commit
aafa0e92ac
|
|
@ -2,16 +2,72 @@
|
|||
namespace Yunshop\WeightValue\admin;
|
||||
|
||||
use app\common\components\BaseController;
|
||||
use app\common\helpers\PaginationHelper;
|
||||
use Yunshop\TeamDividend\models\TeamDividendLevelModel;
|
||||
use Yunshop\WeightValue\models\WeightValue;
|
||||
use Yunshop\WeightValue\models\WeightValueLog;
|
||||
|
||||
class IndexController extends BaseController{
|
||||
|
||||
|
||||
/**
|
||||
* Common: 进入权重值列表
|
||||
* Author: wu-hui
|
||||
* Time: 2023/10/12 15:40
|
||||
* @return array|string
|
||||
* @throws \Throwable
|
||||
*/
|
||||
public function index(){
|
||||
//参数获取
|
||||
$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
|
||||
];
|
||||
|
||||
return view('Yunshop\WeightValue::index.index',$data)->render();
|
||||
}
|
||||
// 查看变更记录
|
||||
public function changeRecord(){
|
||||
// 参数获取
|
||||
$memberId = (int)request()->input('member_id');
|
||||
$levelId = (int)request()->input('level_id');
|
||||
$isGet = (int)request()->input('is_get');
|
||||
$search = request()->input('search');
|
||||
if($isGet){
|
||||
// 获取变更记录
|
||||
$field = [
|
||||
'id',
|
||||
'team_dividend_agency_level_id',
|
||||
'change_type',
|
||||
'change_quantity',
|
||||
'change_front',
|
||||
'change_after',
|
||||
'remark',
|
||||
'created_at'
|
||||
];
|
||||
$result = WeightValueLog::getList(10,$search,$field);
|
||||
|
||||
return $this->successJson('success',[
|
||||
'current_page' => $result['current_page'],
|
||||
'data' => $result['data'],
|
||||
'last_page' => $result['last_page'],
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
return view('Yunshop\WeightValue::index.index')->render();
|
||||
return view('Yunshop\WeightValue::index.change_record',[
|
||||
'member_id' => $memberId,
|
||||
'level_id' => $levelId,
|
||||
'is_get' => $isGet,
|
||||
])->render();
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -21,4 +77,6 @@ class IndexController extends BaseController{
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,16 +3,20 @@ namespace Yunshop\WeightValue\models;
|
|||
|
||||
|
||||
use app\common\models\BaseModel;
|
||||
use app\common\models\Member;
|
||||
use app\common\models\member\MemberParent;
|
||||
use app\common\models\OrderGoods;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Yunshop\TeamDividend\models\TeamDividendAgencyModel;
|
||||
use Yunshop\TeamDividend\models\TeamDividendLevelModel;
|
||||
|
||||
class WeightValue extends BaseModel{
|
||||
|
||||
public $table = 'yz_weight_value';
|
||||
public $timestamps = false;
|
||||
|
||||
private static $weightValueLevelTotal = [];// 每个等级的权重值总数列表
|
||||
|
||||
|
||||
/**
|
||||
* Common: 购买商品赠送权重值 - 开始处理
|
||||
|
|
@ -229,13 +233,90 @@ class WeightValue extends BaseModel{
|
|||
$weightValueModel->save();
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Common: 获取权重值列表
|
||||
* Author: wu-hui
|
||||
* Time: 2023/10/12 15:35
|
||||
* @param $pageSize
|
||||
* @param $search
|
||||
* @param string[] $field
|
||||
* @return array
|
||||
*/
|
||||
public static function getList($pageSize,$search){
|
||||
// 条件生成
|
||||
$where = [];
|
||||
if($search['member_id'] > 0) $where[] = ['member_id','=',$search['member_id']];
|
||||
if($search['team_dividend_agency_level_id'] > 0) $where[] = ['team_dividend_agency_level_id','=',$search['team_dividend_agency_level_id']];
|
||||
// 列表获取
|
||||
$list = self::uniacid()
|
||||
->where($where)
|
||||
->with([
|
||||
'member' => function($query){
|
||||
$query->select(['uid','nickname','realname','avatar']);
|
||||
},
|
||||
'level' => function($query){
|
||||
$query->select(['id','level_name']);
|
||||
},
|
||||
])
|
||||
->orderBy('id','DESC')
|
||||
->paginate($pageSize)
|
||||
->toArray();
|
||||
// 根据经销商等级id分组 根据id大小排序 获取排序序号
|
||||
$group = self::uniacid()->groupBy('team_dividend_agency_level_id')->pluck('team_dividend_agency_level_id');
|
||||
$group = $group ? $group->toArray() : [];
|
||||
sort($group);
|
||||
$group = array_flip($group);
|
||||
// 循环处理数据
|
||||
foreach($list['data'] as &$item){
|
||||
// 获取总数及比例
|
||||
[$item['total_quantity'],$item['ratio']] = self::getTotalAndRatio((int)$item['team_dividend_agency_level_id'],$item['quantity']);
|
||||
// 排序序号
|
||||
$item['sort'] = $group[(int)$item['team_dividend_agency_level_id']];
|
||||
}
|
||||
|
||||
return $list;
|
||||
}
|
||||
/**
|
||||
* Common: 根据经销商等级id及持有数量 获取该等级总数及持有数量占比
|
||||
* Author: wu-hui
|
||||
* Time: 2023/10/12 16:10
|
||||
* @param int $levelId
|
||||
* @param $quantity
|
||||
* @return array
|
||||
*/
|
||||
public static function getTotalAndRatio(int $levelId,$quantity){
|
||||
$name = \YunShop::app()->uniacid.'_'.$levelId;
|
||||
// 获取当前等级的总权重值
|
||||
if(array_key_exists($name,self::$weightValueLevelTotal)){
|
||||
$total = self::$weightValueLevelTotal[$name];
|
||||
}else{
|
||||
$total = self::uniacid()->where('team_dividend_agency_level_id',$levelId)->sum('quantity');
|
||||
self::$weightValueLevelTotal[$name] = $total;
|
||||
}
|
||||
// 计算比例
|
||||
$ratio = sprintf("%.2f",$quantity / $total * 100);
|
||||
|
||||
return [$total,$ratio];
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Common: 一对一关联 用户信息
|
||||
* Author: wu-hui
|
||||
* Time: 2023/10/12 15:33
|
||||
* @return mixed
|
||||
*/
|
||||
public function member(){
|
||||
return $this->hasOne(Member::class, 'uid', 'member_id');
|
||||
}
|
||||
/**
|
||||
* Common: 一对一关联 经销商等级信息
|
||||
* Author: wu-hui
|
||||
* Time: 2023/10/12 15:36
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasOne
|
||||
*/
|
||||
public function level(){
|
||||
return $this->hasOne(TeamDividendLevelModel::class, 'id', 'team_dividend_agency_level_id');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ namespace Yunshop\WeightValue\models;
|
|||
|
||||
use app\common\models\BaseModel;
|
||||
use app\common\models\Member;
|
||||
use Yunshop\TeamDividend\models\TeamDividendLevelModel;
|
||||
|
||||
class WeightValueLog extends BaseModel{
|
||||
|
||||
|
|
@ -14,7 +15,7 @@ class WeightValueLog extends BaseModel{
|
|||
protected $fillable = [
|
||||
'uniacid',
|
||||
'member_id',
|
||||
'type',
|
||||
'team_dividend_agency_level_id',
|
||||
'goods_id',
|
||||
'order_id',
|
||||
'order_goods_id',
|
||||
|
|
@ -26,11 +27,10 @@ class WeightValueLog extends BaseModel{
|
|||
'created_at',
|
||||
];
|
||||
|
||||
|
||||
/**
|
||||
* Common: 获取列表
|
||||
* Common: 权重值变更记录
|
||||
* Author: wu-hui
|
||||
* Time: 2023/09/27 14:04
|
||||
* Time: 2023/10/12 17:48
|
||||
* @param $pageSize
|
||||
* @param $search
|
||||
* @param string[] $field
|
||||
|
|
@ -40,29 +40,27 @@ class WeightValueLog extends BaseModel{
|
|||
// 条件生成
|
||||
$where = [];
|
||||
if($search['member_id'] > 0) $where[] = ['member_id','=',$search['member_id']];
|
||||
// if($search['type'] >= 0 && !is_null($search['type'])) $where[] = ['type','=',$search['type']];
|
||||
if($search['change_type'] >= 0 && !is_null($search['change_type'])) $where[] = ['change_type','=',$search['change_type']];
|
||||
if($search['team_dividend_agency_level_id'] > 0) $where[] = ['team_dividend_agency_level_id','=',$search['team_dividend_agency_level_id']];
|
||||
if($search['change_type'] >= 0 && $search['change_type'] != '') $where[] = ['change_type','=',$search['change_type']];
|
||||
// 列表获取
|
||||
$list = self::uniacid()
|
||||
->select($field)
|
||||
->where($where)
|
||||
->with(['member'=>function($query){
|
||||
$query->select(['uid','nickname','realname','avatar']);
|
||||
}])
|
||||
->with([
|
||||
'member' => 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/09/27 17:49
|
||||
* @param $uid
|
||||
* @param int $changeType
|
||||
* @return string
|
||||
*/
|
||||
// 获取总数
|
||||
public function getChangeTypeSum($uid,$changeType = -1){
|
||||
$where = [];
|
||||
if($changeType == 0) $where[] = ['change_type','=',0];
|
||||
|
|
@ -72,16 +70,7 @@ class WeightValueLog extends BaseModel{
|
|||
|
||||
return sprintf("%.2f",$sum);
|
||||
}
|
||||
/**
|
||||
* Common: 权重值增加|减少操作
|
||||
* Author: wu-hui
|
||||
* Time: 2023/09/27 17:12
|
||||
* @param int $uid
|
||||
* @param float $money
|
||||
* @param int $changeType
|
||||
* @param string $remark
|
||||
* @param int $type
|
||||
*/
|
||||
// 权重值增加|减少操作
|
||||
public function weightValueOperate(int $uid,float $money,int $changeType = 1,string $remark = '',int $type = 0){
|
||||
// 获取当前用户持有数量
|
||||
$changeFront = (float)Member::uniacid()->where('uid',$uid)->value('weight_value');
|
||||
|
|
@ -113,13 +102,21 @@ class WeightValueLog extends BaseModel{
|
|||
/**
|
||||
* Common: 一对一关联 用户信息
|
||||
* Author: wu-hui
|
||||
* Time: 2023/09/27 13:43
|
||||
* Time: 2023/10/12 17:49
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasOne
|
||||
*/
|
||||
public function member(){
|
||||
return $this->hasOne(Member::class, 'uid', 'member_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* Common: 一对一关联 经销商等级信息
|
||||
* Author: wu-hui
|
||||
* Time: 2023/10/12 15:36
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasOne
|
||||
*/
|
||||
public function level(){
|
||||
return $this->hasOne(TeamDividendLevelModel::class, 'id', 'team_dividend_agency_level_id');
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,116 @@
|
|||
<style>
|
||||
.el-pagination{
|
||||
text-align: right!important;
|
||||
}
|
||||
</style>
|
||||
<div id="changeRecord" class="w1200 m0a">
|
||||
<div class="rightlist">
|
||||
<div id="app">
|
||||
{{--搜索--}}
|
||||
<el-form :inline="true" :model="search_list">
|
||||
<el-form-item label="变更类型">
|
||||
<el-select v-model="search_list.change_type" placeholder="全部">
|
||||
<el-option label="全部" value=""></el-option>
|
||||
<el-option label="减少" value="0"></el-option>
|
||||
<el-option label="增加" value="1"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="clickSearch">查询</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
{{--表单--}}
|
||||
<el-table :data="list" style="width: 100%">
|
||||
<el-table-column align="center" prop="id" label="ID" width="80"></el-table-column>
|
||||
<el-table-column align="center" prop="change_front" label="变更前持有数" width="150"></el-table-column>
|
||||
<el-table-column align="center" prop="change_type" label="变更类型" width="150">
|
||||
<template slot-scope="scope">
|
||||
<el-tag :type="scope.row.status === 0 ? 'danger' : 'success'" disable-transitions>
|
||||
[[scope.row.status === 0 ? '减少' : '增加']]
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" prop="change_quantity" label="变更数量" width="150"></el-table-column>
|
||||
<el-table-column align="center" prop="change_after" label="变更后持有数"></el-table-column>
|
||||
<el-table-column align="center" prop="remark" label="变更原因"></el-table-column>
|
||||
<el-table-column align="center" prop="created_at" label="变更时间" width="200"></el-table-column>
|
||||
</el-table>
|
||||
{{--分页--}}
|
||||
<el-pagination
|
||||
v-if="total_page > 1"
|
||||
background
|
||||
layout="prev, pager, next"
|
||||
:page-count="total_page"
|
||||
:current-page="page"
|
||||
@current-change="changePage">
|
||||
</el-pagination>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
new Vue({
|
||||
el: '#app',
|
||||
delimiters: ['[[', ']]'],
|
||||
name: 'change_record',
|
||||
data: {
|
||||
page: 1,
|
||||
total_page: 1,
|
||||
list: [],
|
||||
search_list: {
|
||||
member_id: "{{$member_id}}",
|
||||
team_dividend_agency_level_id: "{{$level_id}}",
|
||||
change_type: '',
|
||||
}
|
||||
},
|
||||
watch:{},
|
||||
mounted () {
|
||||
this.getChangeRecord();
|
||||
},
|
||||
methods: {
|
||||
// 获取变更记录
|
||||
getChangeRecord(){
|
||||
let _this = this;
|
||||
let loading = _this.showLoading();
|
||||
$.ajax({
|
||||
url: "{!! yzWebUrl('plugin.weight-value.admin.index.changeRecord') !!}",
|
||||
type: "post",
|
||||
data: {
|
||||
page: _this.page,
|
||||
search: _this.search_list,
|
||||
is_get: 1
|
||||
},
|
||||
success: function(result) {
|
||||
loading.close(0);
|
||||
let data = result.data;
|
||||
if(parseInt(result.result) === 1){
|
||||
// 处理数据
|
||||
_this.list = data.data;
|
||||
_this.total_page = data.last_page;
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
// 显示加载动画
|
||||
showLoading(){
|
||||
return this.$loading({
|
||||
lock: true,
|
||||
text: 'Loading',
|
||||
spinner: 'el-icon-loading',
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
});
|
||||
},
|
||||
// 数据分页
|
||||
changePage(val){
|
||||
this.page = val;
|
||||
this.getChangeRecord();
|
||||
},
|
||||
// 订单 - 相关搜索
|
||||
clickSearch(){
|
||||
this.page = 1;
|
||||
this.getChangeRecord()
|
||||
},
|
||||
},
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
|
|
@ -1,4 +1,3 @@
|
|||
<script src="{!!resource_absolute('static/js/xlsx.full.min.js')!!}"></script>
|
||||
@extends('layouts.base')
|
||||
<style>
|
||||
.user{
|
||||
|
|
@ -35,36 +34,20 @@
|
|||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
.margin-bottom-15{
|
||||
margin-bottom: 15px;
|
||||
.level_0{
|
||||
background-color: #5bc0de!important;
|
||||
}
|
||||
.select-user-btn{
|
||||
height: 34px!important;
|
||||
.level_1{
|
||||
background-color: #f0ad4e!important;
|
||||
}
|
||||
select{
|
||||
width: calc((100% - 20px) / 3) !important;
|
||||
height: 34px;
|
||||
border-color: #ccc!important;
|
||||
color: #555 !important;
|
||||
background-color: #fff!important;
|
||||
.level_2{
|
||||
background-color: #5cb85c!important;
|
||||
}
|
||||
select:not(:last-child){
|
||||
margin-right: 10px!important;
|
||||
.level_3{
|
||||
background-color: #337ab7!important;
|
||||
}
|
||||
.apply_image{
|
||||
max-height: 80px;
|
||||
max-width: 80px;
|
||||
}
|
||||
.image_a{
|
||||
padding: 0!important;
|
||||
height: 80px;
|
||||
width: 80px;
|
||||
display: inline-flex!important;
|
||||
flex-direction: row;
|
||||
justify-content: center;
|
||||
align-items: flex-end;
|
||||
flex-wrap: nowrap;
|
||||
border: unset!important;
|
||||
.level_4{
|
||||
background-color: #d9534f!important;
|
||||
}
|
||||
</style>
|
||||
@section('content')
|
||||
|
|
@ -77,48 +60,23 @@
|
|||
<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[team_dividend_agency_uid]" id="" type="text" value="{{ $search['team_dividend_agency_uid'] }}" placeholder="引荐人用户ID">
|
||||
<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[uid]" id="" type="text" value="{{ $search['uid'] }}" placeholder="终端商用户ID">
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-8 col-lg-3">
|
||||
<input class="form-control" name="search[title]" id="" type="text" value="{{ $search['title'] }}" placeholder="店铺名称">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<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_name]" id="" type="text" value="{{ $search['member_name'] }}" placeholder="引荐人昵称或者真实姓名">
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-8 col-lg-3">
|
||||
<input class="form-control" name="search[contacts]" id="" type="text" value="{{ $search['contacts'] }}" placeholder="注册人姓名">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-sm-11 col-xs-12">
|
||||
<div class="row row-fix tpl-category-container" >
|
||||
<input type="hidden" id="province_id" value="{{ $search['province_id']?:0 }}"/>
|
||||
<input type="hidden" id="city_id" value="{{ $search['city_id']?:0 }}"/>
|
||||
<input type="hidden" id="area_id" value="{{ $search['area_id']?:0 }}"/>
|
||||
<div class="col-xs-12 col-sm-8 col-lg-6">
|
||||
{!! app\common\helpers\AddressHelper::tplLinkedAddress(['search[province_id]','search[city_id]','search[area_id]'], []) !!}
|
||||
<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">
|
||||
<input type="hidden" name="is_apply" value="{{$is_apply}}"/>
|
||||
<button type="button" name="export" value="1" id="export" class="btn btn-default excel back ">导出 Excel</button>
|
||||
@if (!$is_apply)
|
||||
<button type="button" class="btn btn-primary editInfoBtn"><i class="fa fa-plus"></i> 添加</button>
|
||||
@endif
|
||||
<button class="btn btn-success" id="search"><i class="fa fa-search"></i> 搜索</button>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -131,19 +89,13 @@
|
|||
<table class="table" style="min-width:1500px;overflow: auto;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="text-align:center;width: 80px;">ID</th>
|
||||
<th style="text-align:left;">终端商信息</th>
|
||||
<th style="text-align:left;">引荐人信息</th>
|
||||
<th style="text-align:left;">注册人信息</th>
|
||||
<th style="text-align:center;width: 100px;">营业执照</th>
|
||||
<th style="text-align:center;width: 100px;">门头照片</th>
|
||||
<th style="text-align:center;width: 100px;">内部照片</th>
|
||||
<th style="text-align:center;width: 200px;">
|
||||
@if($is_apply)
|
||||
申请时间
|
||||
@else
|
||||
审核时间
|
||||
@endif
|
||||
<th style="text-align:center;width: 120px;">ID</th>
|
||||
<th style="text-align:left;">用户信息</th>
|
||||
<th style="text-align:center;">权重值类型</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;width: 350px;">操作</th>
|
||||
</tr>
|
||||
|
|
@ -152,86 +104,31 @@
|
|||
@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['header_image']}}" />
|
||||
</div>
|
||||
<div class="user-info">
|
||||
<div class="user-nickname">{{ $item['title'] }}</div>
|
||||
<div class="user-nickname">
|
||||
{{ $item['province_info']['areaname'] }}{{ $item['city_info']['areaname'] }}{{ $item['area_info']['areaname'] }}
|
||||
</div>
|
||||
<div class="user-status">
|
||||
{{--状态:0=待审核,1=使用中,2=驳回--}}
|
||||
@if ($item['status'] == 0)
|
||||
<label class="label label-default">待审核</label>
|
||||
@elseif ($item['status'] == 1)
|
||||
<label class="label label-success">使用中</label>
|
||||
@elseif ($item['status'] == 2)
|
||||
<label class="label label-danger">已驳回</label>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td style="text-align:left;" >
|
||||
<div class="user">
|
||||
<div class="user-avatar">
|
||||
<img class="avatar-image" src="{{$item['team_dividend_member']['avatar_image']}}" />
|
||||
<img class="avatar-image" src="{{$item['member']['avatar_image']}}" />
|
||||
</div>
|
||||
<div class="user-info">
|
||||
<div class="user-nickname">昵称:{{ $item['team_dividend_member']['nickname'] }}</div>
|
||||
<div class="user-status">ID:{{ $item['team_dividend_member']['uid'] }}</div>
|
||||
<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="contacts">
|
||||
注册人:{{ $item['contacts'] }}<br />
|
||||
联系电话:{{ $item['contacts_phone'] }}<br />
|
||||
</div>
|
||||
<td style="text-align:center;">
|
||||
<span class="label level_{{$item['sort']}}">
|
||||
{{ $item['level'] ? $item['level']['level_name'].'权重值' : '' }}
|
||||
</span>
|
||||
</td>
|
||||
<td style="text-align:center;">
|
||||
<a target="_blank" href="{{tomedia($item['business_license_image'])}}" class="image_a">
|
||||
<img class="apply_image" src='{{tomedia($item['business_license_image'])}}' /><br/>
|
||||
</a>
|
||||
<span class="label label-default">{{ $item['total_quantity'] }}</span>
|
||||
<span class="label label-info">{{ $item['quantity'] }}</span>
|
||||
<span class="label label-warning">{{ $item['ratio'].'%' }}</span>
|
||||
</td>
|
||||
<td style="text-align:center;">
|
||||
<a target="_blank" href="{{tomedia($item['header_image'])}}" class="image_a">
|
||||
<img class="apply_image" src='{{tomedia($item['header_image'])}}' /><br/>
|
||||
</a>
|
||||
</td>
|
||||
<td style="text-align:center;">
|
||||
<a target="_blank" href="{{tomedia($item['internal_image'])}}" class="image_a">
|
||||
<img class="apply_image" src='{{tomedia($item['internal_image'])}}' /><br/>
|
||||
</a>
|
||||
</td>
|
||||
<td style="text-align:center;">
|
||||
@if($is_apply)
|
||||
{{ $item['created_at'] }}
|
||||
@else
|
||||
{{ $item['to_examine_time'] }}
|
||||
@endif
|
||||
</td>
|
||||
<td style="text-align:center;">
|
||||
@if ($is_apply)
|
||||
{{--审核内容--}}
|
||||
@if ($item['status'] == 0)
|
||||
<button onclick="pass({{$item['id']}})" type="button" class="btn btn-success btn-sm">审核通过</button>
|
||||
<button type="button" onclick="popupRejectReason({{$item['id']}})" class="btn btn-danger btn-sm">驳回申请</button>
|
||||
@endif
|
||||
<a href="{{yzWebUrl('plugin.weight-value.admin.index.editInfo', ['id' => $item['id'], 'is_see' => TRUE])}}">
|
||||
<button type="button" class="btn btn-primary btn-sm">详情</button>
|
||||
</a>
|
||||
@else
|
||||
{{--使用中内容--}}
|
||||
<a href="{{yzWebUrl('plugin.weight-value.admin.index.editInfo', ['id' => $item['id']])}}">
|
||||
<button type="button" class="btn btn-success btn-sm">编辑</button>
|
||||
</a>
|
||||
<button onclick="del({{$item['id']}})" type="button" class="btn btn-danger btn-sm">删除</button>
|
||||
<button onclick="seeSalesInfo({{$item['id']}})" type="button" class="btn btn-info btn-sm">销售统计</button>
|
||||
@endif
|
||||
<button onclick="seeDetail({{$item['member_id']}},{{$item['team_dividend_agency_level_id']}})" type="button" class="btn btn-info btn-sm">
|
||||
变更明细
|
||||
</button>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
|
|
@ -240,116 +137,17 @@
|
|||
{!! $pager !!}
|
||||
</div>
|
||||
</div>
|
||||
{{--驳回弹框--}}
|
||||
<div id="reject-popup" class="modal fade">
|
||||
<div class="modal-dialog" style='width: 920px;'>
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button aria-hidden="true" data-dismiss="modal" class="close" type="button">×</button>
|
||||
<h3>驳回申请</h3>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="row">
|
||||
<div class="input-group">
|
||||
<textarea name="reject_reason" maxlength="200" cols="120" rows="15" placeholder="请输入驳回原因(200字以内)"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div id="module-menus-goods" style="padding-top:5px;"></div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<input type="button" value="确认" onclick="submitReject()" class="btn btn-primary"/>
|
||||
<a href="#" class="btn btn-default" data-dismiss="modal" aria-hidden="true">关闭</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript" src="{{static_url('js/area/cascade_street.js')}}"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
var apply_id = 0;// 终端商信息id
|
||||
window.history.replaceState(null, null, window.location.href);
|
||||
// 地区初始化
|
||||
var province_id = $('#province_id').val();
|
||||
var city_id = $('#city_id').val();
|
||||
var area_id = $('#area_id').val();
|
||||
cascdeInit(province_id, city_id, area_id);
|
||||
|
||||
|
||||
$(function () {
|
||||
// 编辑终端商
|
||||
$("#terminalMerchantsIndex").on('click','.editInfoBtn',function () {
|
||||
let id = $(this).data('id') || 0;
|
||||
window.location.href = "{!! yzWebUrl('plugin.weight-value.admin.index.editInfo') !!}" + '&id=' + id;
|
||||
});
|
||||
// 点击导出
|
||||
$('#export').click(function(){
|
||||
@if (!$is_apply)
|
||||
$('#form1').get(0).action = "{!! yzWebUrl('plugin.weight-value.admin.index.export') !!}";
|
||||
$('#form1').submit();
|
||||
$('#form1').get(0).action= "{!! yzWebUrl('plugin.weight-value.admin.index.index') !!}";
|
||||
@else
|
||||
$('#form1').get(0).action = "{!! yzWebUrl('plugin.weight-value.admin.index.apply_export') !!}";
|
||||
$('#form1').submit();
|
||||
$('#form1').get(0).action= "{!! yzWebUrl('plugin.weight-value.admin.index.apply') !!}";
|
||||
@endif
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
// 填写驳回原因
|
||||
function popupRejectReason(id){
|
||||
apply_id = id;
|
||||
$('#reject-popup').modal();//填写驳回理由
|
||||
}
|
||||
// 提交驳回
|
||||
function submitReject(){
|
||||
var reject_reason = $("textarea[name='reject_reason']").val();
|
||||
var link = "{{yzWebUrl('plugin.weight-value.admin.index.reject')}}" + '&id=' + apply_id + '&reject_reason=' + reject_reason;
|
||||
// 判断:是否存在驳回原因
|
||||
if(reject_reason.length <= 0){
|
||||
alert('请输入驳回原因');
|
||||
return false;
|
||||
}
|
||||
|
||||
window.location.href = link;
|
||||
}
|
||||
// 审核通过
|
||||
var is_click_button = false;
|
||||
function pass(id){
|
||||
// 防止重复点击
|
||||
loadShow();
|
||||
if(is_click_button) return false;
|
||||
is_click_button = true;
|
||||
// 通过审核
|
||||
window.location.href = "{{yzWebUrl('plugin.weight-value.admin.index.pass')}}" + '&id=' + id;
|
||||
}
|
||||
// 删除终端商
|
||||
function del(id){
|
||||
let link = "{{yzWebUrl('plugin.weight-value.admin.index.del')}}" + '&id=' + id;
|
||||
// 通过审核
|
||||
let popup = util.confirm('确认删除当前终端商信息吗?',{
|
||||
confirm:function () {
|
||||
// 加载动画
|
||||
loadShow();
|
||||
// 关闭弹框
|
||||
popup.modal('hide');
|
||||
|
||||
window.location.href = link;
|
||||
}
|
||||
});
|
||||
}
|
||||
// 查看销售信息统计
|
||||
function seeSalesInfo(id){
|
||||
let link = "{{yzWebUrl('plugin.weight-value.admin.sales.index')}}" + `&id=${id}`;
|
||||
let popup = util.ajaxshow(link,'查看销售统计',{
|
||||
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