main
yangsai 1 month ago
parent b7bbd5d037
commit e0aca3b55f
  1. 15
      app/massage/controller/AdminCoach.php
  2. 2
      app/massage/controller/AdminSetting.php
  3. 9
      app/massage/controller/AdminUser.php
  4. 682
      app/massage/controller/Index.php
  5. 14
      app/massage/controller/IndexCoach.php
  6. 15
      app/massage/controller/IndexUser.php
  7. 84
      app/massage/model/Coach.php
  8. 9
      app/massage/model/Commission.php
  9. 9
      app/massage/model/Order.php
  10. 1
      app/massage/route/route.php
  11. 11
      app/mobilenode/controller/IndexAgentOrder.php
  12. 9
      后端UI/src/api/modules/service.js
  13. 31
      后端UI/src/view/custom/list.vue
  14. 4
      后端UI/src/view/finance/finance/record.vue
  15. 30
      后端UI/src/view/shop/order/bell.vue
  16. 36
      后端UI/src/view/shop/order/list.vue
  17. 17
      后端UI/src/view/technician/edit.vue
  18. 12
      后端UI/src/view/technician/list.vue

@ -155,13 +155,18 @@ class AdminCoach extends AdminRest
}
$data = $this->model->dataList($dis,$input['limit'],$where);
$level_model = new CoachLevel();
if(!empty($data['data'])){
foreach ($data['data'] as &$v){
$v['levelname'] = "无等级";
$v['balance'] = "0%";
//$user_model->checkCoachCash($v);
if($v['level']){
$levelinfo = $level_model->dataInfo(['id'=>$v['level']]);
$v['levelname'] = $levelinfo['title'];
$v['balance'] = $levelinfo['balance'].'%';
}
$v['partner_name'] = $user_model->where(['id'=>$v['partner_id']])->value('nickName');
//绑定门店
if(!empty($v['store_id'])){
@ -184,7 +189,7 @@ class AdminCoach extends AdminRest
5=>'update_num'
];
foreach ($list as $k=> $value){
$dis_s = [];
@ -195,7 +200,7 @@ class AdminCoach extends AdminRest
$dis_s[] = ['admin_id','in',$this->admin_arr];
}
if(!empty($k)&&$k!=5){
$dis_s[] = ['status','=',$k];

@ -925,7 +925,7 @@ class AdminSetting extends AdminRest
];
$cash_model = new Commission();
$cash = $cash_model->where($dis)->where('type','in',[2,5,6])->find();
if(!empty($cash)){

@ -651,7 +651,14 @@ class AdminUser extends AdminRest
}
public function delUser(){
$input = $this->_param;
$input['ids'] = rtrim($input['id'],',');
$ids = explode(",",$input['ids']);
$result = $this->model->where('id','in',$ids)->delete();
return $this->success($result);
}
/**

File diff suppressed because it is too large Load Diff

@ -278,9 +278,12 @@ class IndexCoach extends ApiRest
*/
public function orderList()
{
$input = $this->_param;
if (empty($this->cap_info['id'])) {
$this->errorMsg('你还不是技师');
}
$dis[] = ['a.uniacid', '=', $this->_uniacid];
$dis[] = ['a.coach_id', '=', $this->cap_info['id']];
@ -422,7 +425,13 @@ class IndexCoach extends ApiRest
'text' => $input['text'],
'type' => $input['type'],
'chikaren' => !empty($input['chikaren'])?$input['chikaren']:'',
'kaihuhang' => !empty($input['kaihuhang'])?$input['kaihuhang']:'',
'suoshuzhihang' => !empty($input['suoshuzhihang'])?$input['suoshuzhihang']:'',
'yinhangkahao' => !empty($input['yinhangkahao'])?$input['yinhangkahao']:'',
'apply_transfer' => !empty($input['apply_transfer'])?$input['apply_transfer']:0
];
@ -921,6 +930,7 @@ class IndexCoach extends ApiRest
*/
public function getOrderNum()
{
$data = [
'wait' => $this->order_model->getOrderNum([['uniacid', '=', $this->_uniacid], ['coach_id', '=', $this->cap_info['id']], ['pay_type', '=', 2]]),
'start' => $this->order_model->getOrderNum([['uniacid', '=', $this->_uniacid], ['coach_id', '=', $this->cap_info['id']], ['pay_type', 'in', [3, 4, 5]]]),

@ -115,14 +115,16 @@ class IndexUser extends ApiRest
* @功能说明:个人中心
*/
public function index(){
// print_r( $this->getUserId());die;
if(empty($this->getUserId())){
return $this->success([]);
}
$data = $this->model->dataInfo(['id'=>$this->getUserId()]);
if(empty($data)){
$this->errorMsg('need login',401);
}
//获取各类角色的审核结果
$data = $this->model->authCheckData($data);
//优惠券数
@ -1303,7 +1305,14 @@ class IndexUser extends ApiRest
'type' => 4,
'apply_transfer' => !empty($input['apply_transfer'])?$input['apply_transfer']:0
'apply_transfer' => !empty($input['apply_transfer'])?$input['apply_transfer']:0,
'chikaren' => !empty($input['chikaren'])?$input['chikaren']:'',
'kaihuhang' => !empty($input['kaihuhang'])?$input['kaihuhang']:'',
'suoshuzhihang' => !empty($input['suoshuzhihang'])?$input['suoshuzhihang']:'',
'yinhangkahao' => !empty($input['yinhangkahao'])?$input['yinhangkahao']:'',
];

@ -625,52 +625,58 @@ class Coach extends BaseModel
*/
public function getCoachLevel($caoch_id, $uniacid)
{
$coach_model = new Coach();
$config_model = new Config();
$level_model = new CoachLevel();
$config = $config_model->dataInfo(['uniacid'=>$uniacid]);
$level_cycle = $config['level_cycle'];
$is_current = $config['is_current'];
//时长(分钟)
$time_long = $level_model->getMinTimeLong($caoch_id,$level_cycle,$is_current);
//最低业绩
$price = $level_model->getMinPrice($caoch_id,$level_cycle,0,$is_current);
//加钟订单
$add_price = $level_model->getMinPrice($caoch_id,$level_cycle,1,$is_current);
//积分
$integral = $level_model->getMinIntegral($caoch_id,$level_cycle,$is_current);
//在线时长
$online_time = $level_model->getCoachOnline($caoch_id,$level_cycle,$is_current);
$level = $level_model->where(['uniacid' => $uniacid, 'status' => 1])->order('time_long,id desc')->select()->toArray();
$coach_level = [];
$add_balance = $price>0?$add_price/$price*100:0;
if (!empty($level)) {
foreach ($level as $key=>$value) {
//时长
$level_time_long = $key>0? $level[$key-1]['time_long']:0;
if($time_long>=$level_time_long&&$price>=$value['price']&&$add_balance>=$value['add_balance']&&$integral>=$value['integral']&&$online_time>=$value['online_time']){
$coach_level = $value;
}elseif (empty($coach_level)) {
//都不符合给一个最低都等级
$coach_level = $value;
$coach = $coach_model->dataInfo(['id'=>$caoch_id]);
if($coach['level']){
$coach_level = $level_model->dataInfo(['id'=>$coach['level']]);
}else{
$config = $config_model->dataInfo(['uniacid'=>$uniacid]);
$level_cycle = $config['level_cycle'];
$is_current = $config['is_current'];
//时长(分钟)
$time_long = $level_model->getMinTimeLong($caoch_id,$level_cycle,$is_current);
//最低业绩
$price = $level_model->getMinPrice($caoch_id,$level_cycle,0,$is_current);
//加钟订单
$add_price = $level_model->getMinPrice($caoch_id,$level_cycle,1,$is_current);
//积分
$integral = $level_model->getMinIntegral($caoch_id,$level_cycle,$is_current);
//在线时长
$online_time = $level_model->getCoachOnline($caoch_id,$level_cycle,$is_current);
$level = $level_model->where(['uniacid' => $uniacid, 'status' => 1])->order('time_long,id desc')->select()->toArray();
$coach_level = [];
$add_balance = $price>0?$add_price/$price*100:0;
if (!empty($level)) {
foreach ($level as $key=>$value) {
//时长
$level_time_long = $key>0? $level[$key-1]['time_long']:0;
if($time_long>=$level_time_long&&$price>=$value['price']&&$add_balance>=$value['add_balance']&&$integral>=$value['integral']&&$online_time>=$value['online_time']){
$coach_level = $value;
}elseif (empty($coach_level)) {
//都不符合给一个最低都等级
$coach_level = $value;
}
}
}
}
return !empty($coach_level)?$coach_level : [];
}

@ -1413,7 +1413,7 @@ class Commission extends BaseModel
public function cashData($order,$type){
$list = $this->commissionData($type);
foreach ($list as $key=>$value){
$balance = isset($order[$value['parameter']])?$order[$value['parameter']]:0;
@ -1426,8 +1426,9 @@ class Commission extends BaseModel
}
$order['admin_cash'] = $order['surplus_cash'];
return $order;
}
@ -1550,7 +1551,7 @@ class Commission extends BaseModel
//技师佣金
$order['coach_cash'] = round($balance*$order['true_service_price']/100,2);
// $order['coach_cash'] = $order['coach_cash']>$cash?$cash:$order['coach_cash'];
// $order['coach_cash'] = $order['coach_cash']>$cash?$cash:$order['coach_cash'];
$order['surplus_cash'] = $cash - $order['coach_cash'];
@ -2380,4 +2381,4 @@ class Commission extends BaseModel
}
}

@ -177,7 +177,7 @@ class Order extends BaseModel
->where(function ($query) use ($mapor){
$query->whereOr($mapor);
})
->group('a.id')
->order('a.id desc')
->paginate($page)
@ -195,7 +195,7 @@ class Order extends BaseModel
}
}
return $data;
}
@ -626,6 +626,7 @@ class Order extends BaseModel
}
//计算佣金
$order = $comm_model->cashData($order,$type);
//转单时候线下技师需要把佣金给到加盟商
if(empty($order['coach_id'])&&!empty($order['admin_id'])){
@ -695,7 +696,7 @@ class Order extends BaseModel
}
//计算佣金
$order = $comm_model->cashDataCustom($order);
//转单时候线下技师需要把佣金给到加盟商
if(empty($order['coach_id'])&&!empty($order['admin_id'])){
@ -2003,4 +2004,4 @@ class Order extends BaseModel
}
}

@ -301,6 +301,7 @@ Route::group('admin', function () {
Route::get('AdminUser/cashList', 'AdminUser/cashList');
Route::post('AdminUser/delUserLabel', 'AdminUser/delUserLabel');
Route::post('AdminUser/delUser', 'AdminUser/delUser');
Route::post('AdminUser/applyWallet', 'AdminUser/applyWallet');

@ -711,7 +711,7 @@ class IndexAgentOrder extends ApiRest
public function applyWallet(){
$input = $this->_input;
if(empty($input['apply_price'])||$input['apply_price']<0.01){
$this->errorMsg('提现费最低一分');
@ -782,6 +782,15 @@ class IndexAgentOrder extends ApiRest
'text' => !empty($input['text'])?$input['text']:'',
'type' => 3,
'chikaren' => !empty($input['chikaren'])?$input['chikaren']:'',
'kaihuhang' => !empty($input['kaihuhang'])?$input['kaihuhang']:'',
'suoshuzhihang' => !empty($input['suoshuzhihang'])?$input['suoshuzhihang']:'',
'yinhangkahao' => !empty($input['yinhangkahao'])?$input['yinhangkahao']:'',
];

@ -28,7 +28,14 @@ export default {
cateUpdate (querys) {
return post('massage/admin/AdminService/cateUpdate', querys)
},
// 审核服务
// 删除订单
orderDelete (querys) {
return post("/massage/admin/AdminOrder/orderdel", querys)
},
delUser(querys) {
return post("massage/admin/AdminUser/delUser", querys)
},
// 审核服务
checkStoreGoods (querys) {
return post('massage/admin/AdminService/checkStoreGoods', querys)
},

@ -121,6 +121,14 @@
v-hasPermi="`${$route.name}-helpPayBalanceOrder`"
>{{ $t('action.helpPayBalanceOrder') }}</lb-button
>
<lb-button
size="mini"
type="danger"
plain
@click="confirmDeluser(scope.row.id, -1)"
v-hasPermi="`${$route.name}-helpPayBalanceOrder`"
>删除</lb-button
>
</div>
</template>
</el-table-column>
@ -373,6 +381,29 @@ export default {
}
})
},
confirmDeluser (id, status) {
this.$confirm(this.$t('tips.confirmDelete'), this.$t('tips.reminder'), {
confirmButtonText: this.$t('action.comfirm'),
cancelButtonText: this.$t('action.cancel'),
type: 'warning'
}).then(() => {
this.updateItemuser(id, status)
}).catch(() => {
})
},
async updateItemuser (id, status) {
this.$api.service.delUser({ id }).then(res => {
if (res.code === 200) {
this.$message.success(this.$t(status === -1 ? 'tips.successDel' : 'tips.successOper'))
this.getTableDataList('', 'list')
} else {
if (status === -1) return
this.getTableDataList('', 'list')
}
})
},
async toDelLabel (uid, id) {
let { code } = await this.$api.custom.delUserLabel({ user_id: uid, label_id: id })
if (code !== 200) return

@ -83,6 +83,10 @@
width="150"
></el-table-column>
<el-table-column prop="text" label="备注" width="200"></el-table-column>
<el-table-column prop="chikaren" label="持卡人" width="200"></el-table-column>
<el-table-column prop="kaihuhang" label="开户行" width="200"></el-table-column>
<el-table-column prop="suoshuzhihang" label="所在支行" width="200"></el-table-column>
<el-table-column prop="yinhangkahao" label="卡号" width="200"></el-table-column>
<el-table-column prop="apply_price" label="申请金额">
<template slot-scope="scope">
<span>¥{{ scope.row.apply_price }}</span>

@ -356,6 +356,14 @@
v-hasPermi="`${$route.name}-view`"
>{{ $t('action.view') }}</lb-button
>
<lb-button
size="mini"
type="danger"
plain
@click="confirmDel(scope.row.id, -1)"
v-hasPermi="`${$route.name}-view`"
>删除</lb-button
>
<lb-button
size="mini"
type="success"
@ -519,6 +527,28 @@ export default {
this.searchForm.page = val
this.getTableDataList()
},
confirmDel (id, status) {
this.$confirm(this.$t('tips.confirmDelete'), this.$t('tips.reminder'), {
confirmButtonText: this.$t('action.comfirm'),
cancelButtonText: this.$t('action.cancel'),
type: 'warning'
}).then(() => {
this.updateItem(id, status)
}).catch(() => {
})
},
async updateItem (id, status) {
this.$api.service.orderDelete({ id }).then(res => {
if (res.code === 200) {
this.$message.success(this.$t(status === -1 ? 'tips.successDel' : 'tips.successOper'))
this.getTableDataList('', 'list')
} else {
if (status === -1) return
this.getTableDataList('', 'list')
}
})
},
/**
* @method 搜索订单列表
*/

@ -367,12 +367,20 @@
<div class="table-operate">
<lb-button
size="mini"
type="primary"
type="danger"
plain
@click="$router.push(`/shop/order/detail?id=${scope.row.id}`)"
@click="confirmDel(scope.row.id, -1)"
v-hasPermi="`${$route.name}-view`"
>{{ $t('action.view') }}</lb-button
>删除</lb-button
>
<lb-button
size="mini"
type="primary"
plain
@click="$router.push(`/shop/order/detail?id=${scope.row.id}`)"
v-hasPermi="`${$route.name}-view`"
>{{ $t('action.view') }}</lb-button
>
<lb-button
size="mini"
type="danger"
@ -928,6 +936,28 @@ export default {
})
this.transferForm = data
},
confirmDel (id, status) {
this.$confirm(this.$t('tips.confirmDelete'), this.$t('tips.reminder'), {
confirmButtonText: this.$t('action.comfirm'),
cancelButtonText: this.$t('action.cancel'),
type: 'warning'
}).then(() => {
this.updateItem(id, status)
}).catch(() => {
})
},
async updateItem (id, status) {
this.$api.service.orderDelete({ id }).then(res => {
if (res.code === 200) {
this.$message.success(this.$t(status === -1 ? 'tips.successDel' : 'tips.successOper'))
this.getTableDataList('', 'list')
} else {
if (status === -1) return
this.getTableDataList('', 'list')
}
})
},
handleTableChange (val, type) {
val = JSON.parse(JSON.stringify(val))
this.currentRow = val

@ -74,6 +74,17 @@
</el-option>
</el-select>
</el-form-item>
<el-form-item label="技师等级设置" prop="level">
<el-select v-model="subForm.level" placeholder="请选择">
<el-option
v-for="item in base_level"
:key="item.id"
:label="item.title"
:value="item.id"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item
label="所属经纪人"
prop=""
@ -380,6 +391,7 @@ export default {
navTitle: '',
base_city: [],
base_store: [],
base_level:[],
showMap: false,
have_user_id: false,
fdd_agreement: {},
@ -409,6 +421,7 @@ export default {
self_img: [], //
video: '',
status: 2,
level:0,
order_num: 0,
is_work: 1,
start_time: '00:00',
@ -464,8 +477,10 @@ export default {
methods: {
async getBaseInfo () {
let { admin_id: aid = 0 } = this.subForm
let [city, store] = await Promise.all([this.$api.system.citySelect(), this.$api.technician.storeSelect({ admin_id: aid })])
let [city, store,level] = await Promise.all([this.$api.system.citySelect(), this.$api.technician.storeSelect({ admin_id: aid }),this.$api.technician.levelList({limit:10000})])
this.base_city = city.data
this.base_level = level.data.data
this.base_store = store.data
},
getCover (img, key) {

@ -162,6 +162,18 @@
label="姓名"
min-width="120"
></el-table-column>
<el-table-column
prop="levelname"
label="等级"
min-width="120"
></el-table-column>
<el-table-column
prop="balance"
label="返佣比例"
min-width="120"
></el-table-column>
<el-table-column
prop="mobile"
label="手机号"

Loading…
Cancel
Save