3.2.12:今日敏感词修改调优并让AI反复剔除无用词汇,新库已可用

3.2.13:售后增加提交售后数量,并修改接口前端对接展示提交的售后数量
  其余问题与后端关系不大
    3.2.14:售后单按照提交时间倒序排列,修改接口
This commit is contained in:
qinzexin 2025-06-14 16:46:54 +08:00
parent 18d3ca14a6
commit 0392286497
13 changed files with 63354 additions and 26 deletions

View File

@ -6,7 +6,7 @@ return [
'Real_price' => '预计应打款额(扣除手续费)', 'Real_price' => '预计应打款额(扣除手续费)',
'Real_have_price' => '最终打款额', 'Real_have_price' => '最终打款额',
'Real_fee_price' => '最终扣除手续费(包含各行转账手续费)', 'Real_fee_price' => '最终扣除手续费',
'Status' => '提现申请状态', 'Status' => '提现申请状态',
'Status 1' => '待审核', 'Status 1' => '待审核',

View File

@ -29,9 +29,20 @@ class UserwithdrawalLog extends Model
'withdrawal_status_text', 'withdrawal_status_text',
'type_text', 'type_text',
'paytime_text', 'paytime_text',
'examinetime_text' 'examinetime_text',
'bank_fee',
]; ];
public function getBankFeeAttr($value, $data)
{
$real_fee_price = $value ? $value : (isset($data['real_fee_price']) ? $data['real_fee_price'] : 0);
$fee_price = $value ? $value : (isset($data['fee_price']) ? $data['fee_price'] : 0);
if(!$real_fee_price)$real_fee_price = $fee_price;
//总手续费 - 平台手续费 = 银行转账手续费
return bcsub($real_fee_price,$fee_price , 2);
}
public function getStatusList() public function getStatusList()

View File

@ -89,7 +89,7 @@ class User extends Api
$this->error(__('获取openid失败'),$result); $this->error(__('获取openid失败'),$result);
} }
Cache::set('tt_miniapp_code'.$code.$result['openid'],"1",60); Cache::set('tt_miniapp_code'.$code.$result['openid'],"1",300);
$this->success('',$result); $this->success('',$result);
} }
@ -128,7 +128,7 @@ class User extends Api
$this->error(__('获取openid失败'),$result); $this->error(__('获取openid失败'),$result);
} }
Cache::set('wechat_miniapp_code'.$code.$result['openid'],"1",60); Cache::set('wechat_miniapp_code'.$code.$result['openid'],"1",300);
$this->success('',$result); $this->success('',$result);
} }

View File

@ -128,6 +128,32 @@ class SettleLog extends Base
$this->success('查询成功', $res); $this->success('查询成功', $res);
} }
/**
* @ApiTitle( 我的提现记录详情)
* @ApiSummary(我的提现记录详情)
* @ApiMethod(GET)
* @ApiParams(name = "id", type = "int",required=true,description = "记录id")
* @ApiReturn({
*
*})
*/
public function withdrawal_log_detail(){
$id = $this->request->get('id/d','');
if(empty($id)){
$this->error(__('缺少必要参数'));
}
try {
$res = (new UserwithdrawalLog)->detail($id);
} catch (\Exception $e){
// Log::log($e->getMessage());
$this->error($e->getMessage(),['errcode'=>$e->getCode()]);
}
$this->success('获取成功', ['detail' => $res]);
}

View File

@ -439,6 +439,9 @@ class Activity extends BaseModel
$activity_end_settle = config("site.activity_end_settle") ?:0; $activity_end_settle = config("site.activity_end_settle") ?:0;
$params["settlement_time"] = $end_time + $activity_end_settle; $params["settlement_time"] = $end_time + $activity_end_settle;
$activity_end_sales = config("site.activity_end_sales") ?:0;
$params["after_sales_time"] = $end_time + $activity_end_sales;
}else{ }else{
if(!$row && empty($params["time"])) throw new \Exception("请选择活动开始和结束时间"); if(!$row && empty($params["time"])) throw new \Exception("请选择活动开始和结束时间");
@ -1112,8 +1115,10 @@ class Activity extends BaseModel
} }
} }
$self["return_50"] = $return_50; $self["return_50"] = $return_50;
$self["last_time"] = $self["end_time"] + config("site.activity_end_sales"); $self["last_time"] = $self["after_sales_time"] ?: $self["end_time"] + config("site.activity_end_sales");
return $self; return $self;
} }
@ -1282,12 +1287,17 @@ class Activity extends BaseModel
//如果活动状态是已结束,则完成所有未核销或者未核销完的订单 //如果活动状态是已结束,则完成所有未核销或者未核销完的订单
//if(in_array($order["status"],["2",'3']) && (in_array($order["server_status"],['0'])) && !$order['finishtime']){ //if(in_array($order["status"],["2",'3']) && (in_array($order["server_status"],['0'])) && !$order['finishtime']){
if($row["status"]=='5'){ if($row["status"]=='5'){
$time = time();
//到达最后可售后时间
$settlement_time= $row["after_sales_time"] ?: $row["end_time"] + config("site.activity_end_sales");
if($time >= $settlement_time){
$order_list = Order::where("status" ,"in",["2","3"])->where(["activity_id"=>$id,"server_status"=>"0"])->select(); $order_list = Order::where("status" ,"in",["2","3"])->where(["activity_id"=>$id,"server_status"=>"0"])->select();
foreach ($order_list as $order){ foreach ($order_list as $order){
//执行订单完成 //执行订单完成
Order::updateFinish($order->order_no); Order::updateFinish($order->order_no);
} }
} }
}

View File

@ -363,7 +363,10 @@ class Order extends BaseModel
$IN_REFUND = '5'; $IN_REFUND = '5';
$alisa = (new self)->getWithAlisaName(); $alisa = (new self)->getWithAlisaName();
$sort = "field({$alisa}.status,'{$NOPAY}','{$PAYED}','{$RESERV}','{$FINISH}','{$REFUND}','{$IN_SERVICE}','{$CANCEL}' ,'{$IN_REFUND}') asc,{$alisa}.id desc"; // $sort = "field({$alisa}.status,'{$NOPAY}','{$PAYED}','{$RESERV}','{$FINISH}','{$REFUND}','{$IN_SERVICE}','{$CANCEL}' ,'{$IN_REFUND}') asc,{$alisa}.id desc";
$sort = "{$alisa}.id desc";
$serch_where = ['status'=>$status,'user_id'=>$user_id,'keywords'=>$keywords,"activity_id"=>$activity_id,"has_evaluate"=>$has_evaluate,"server_status"=>$server_status]; $serch_where = ['status'=>$status,'user_id'=>$user_id,'keywords'=>$keywords,"activity_id"=>$activity_id,"has_evaluate"=>$has_evaluate,"server_status"=>$server_status];
// if($type)$serch_where['type'] = $type; // if($type)$serch_where['type'] = $type;
return (new self)->getBaseList(array_merge($serch_where,$params), $page, $limit,$sort,$with_field); return (new self)->getBaseList(array_merge($serch_where,$params), $page, $limit,$sort,$with_field);
@ -429,7 +432,9 @@ class Order extends BaseModel
$IN_SERVICE = '4'; $IN_SERVICE = '4';
$IN_REFUND = '5'; $IN_REFUND = '5';
$alisa = (new self)->getWithAlisaName(); $alisa = (new self)->getWithAlisaName();
$sort = "field({$alisa}.status,'{$NOPAY}','{$PAYED}','{$RESERV}','{$FINISH}','{$REFUND}','{$IN_SERVICE}','{$CANCEL}','{$IN_REFUND}') asc,{$alisa}.id desc"; // $sort = "field({$alisa}.status,'{$NOPAY}','{$PAYED}','{$RESERV}','{$FINISH}','{$REFUND}','{$IN_SERVICE}','{$CANCEL}','{$IN_REFUND}') asc,{$alisa}.id desc";
$sort = "{$alisa}.id desc";
$serch_where = ['status'=>$status,'keywords'=>$keywords,"activity_id"=>$activity_id,"activity_ids"=>$activity_ids,"server_status"=>$server_status]; $serch_where = ['status'=>$status,'keywords'=>$keywords,"activity_id"=>$activity_id,"activity_ids"=>$activity_ids,"server_status"=>$server_status];
// if($type)$serch_where['type'] = $type; // if($type)$serch_where['type'] = $type;
return (new self)->getBaseList(array_merge($serch_where,$params), $page, $limit,$sort,$with_field); return (new self)->getBaseList(array_merge($serch_where,$params), $page, $limit,$sort,$with_field);
@ -696,7 +701,7 @@ class Order extends BaseModel
$order_data["payprice"] = 0; $order_data["payprice"] = 0;
$order_data["status"] = '0'; $order_data["status"] = '0';
$order_data["settle_log_time"] = $activity_info["settlement_time"]; $order_data["settle_log_time"] = $activity_info["settlement_time"];
$order_data["last_time"] = $activity_info["end_time"] + config("site.activity_end_sales"); $order_data["last_time"] = $activity_info["after_sales_time"] ?: $activity_info["end_time"] + config("site.activity_end_sales");
//根据手续费比例$activity_info["fee_scale"] 计算手续费 //根据手续费比例$activity_info["fee_scale"] 计算手续费
$order_data["fee_price"] = bcmul($order_data["totalprice"],$order_data["fee_scale"],2); $order_data["fee_price"] = bcmul($order_data["totalprice"],$order_data["fee_scale"],2);
//手续费保底不能低于site.activity_settle_min_fee //手续费保底不能低于site.activity_settle_min_fee
@ -2105,7 +2110,8 @@ class Order extends BaseModel
if($check){ if($check){
if(!in_array($order['status'],["2","3","9"])) throw new \Exception("不是可申请售后的订单!"); if(!in_array($order['status'],["2","3","9"])) throw new \Exception("不是可申请售后的订单!");
//申请售后必须是活动结束后n秒内 //申请售后必须是活动结束后n秒内
$last_time = $detail['end_time'] + config('site.activity_end_sales');
$last_time = $detail["after_sales_time"] ?: $detail['end_time'] + config('site.activity_end_sales');
if(time() > $last_time) throw new \Exception("已超过发起售后的最后期限!"); if(time() > $last_time) throw new \Exception("已超过发起售后的最后期限!");
} }
@ -2114,7 +2120,7 @@ class Order extends BaseModel
} }
public function updateAfterSales($order,$total_refundprice,$auth_reason,$check=true){ public function updateAfterSales($order,$total_refundprice,$auth_reason,$num,$check=true){
if(is_numeric($order))$order = self::getHaveAfterSalesOrder($order,$check); if(is_numeric($order))$order = self::getHaveAfterSalesOrder($order,$check);
$order["before_status"] = $order["status"]; $order["before_status"] = $order["status"];
$order["status"] = "4"; $order["status"] = "4";
@ -2124,6 +2130,7 @@ class Order extends BaseModel
$order["auth_reason"] = $auth_reason; $order["auth_reason"] = $auth_reason;
$order["total_refundprice"] = $total_refundprice; $order["total_refundprice"] = $total_refundprice;
$order["first_refundprice"] = $total_refundprice; $order["first_refundprice"] = $total_refundprice;
$order["auth_num"] = $num;
$order->save(); $order->save();
} }
@ -2161,7 +2168,8 @@ class Order extends BaseModel
$res = true; $res = true;
try{ try{
//设置订单申请状态 //设置订单申请状态
$this->updateAfterSales($order,$total_refundprice,$auth_reason,$check); $this->updateAfterSales($order,$total_refundprice,$auth_reason,$num,$check);
//订单日志 //订单日志
OrderLog::log($order['id'],"活动订单申请售后:".$auth_reason, $oper_type, $oper_id); OrderLog::log($order['id'],"活动订单申请售后:".$auth_reason, $oper_type, $oper_id);
@ -2413,8 +2421,13 @@ class Order extends BaseModel
$model = $model->where("{$as}.activity_id",$activity_id); $model = $model->where("{$as}.activity_id",$activity_id);
} }
//查询条件2过了活动结束时间加延期时间的订单 //查询条件2过了活动结束时间加延期时间的订单 after_sales_time 最后可售后时间戳
if($check)$model = $model->where("detail.end_time","<",$delay_time); // if($check)$model = $model->where("detail.end_time","<",$delay_time);
//after_sales_time 最后可售后时间戳
// if($check) $model = $model->where("{$as}.last_time","<",$time);
if($check) $model = $model->where("detail.after_sales_time","<",$time);
$list = $model->select(); $list = $model->select();
if($trans){ if($trans){

View File

@ -32,9 +32,20 @@ class UserwithdrawalLog extends BaseModel
'withdrawal_status_text', 'withdrawal_status_text',
'type_text', 'type_text',
'paytime_text', 'paytime_text',
'examinetime_text' 'examinetime_text',
'bank_fee',
]; ];
public function getBankFeeAttr($value, $data)
{
$real_fee_price = $value ? $value : (isset($data['real_fee_price']) ? $data['real_fee_price'] : 0);
$fee_price = $value ? $value : (isset($data['fee_price']) ? $data['fee_price'] : 0);
if(!$real_fee_price)$real_fee_price = $fee_price;
//总手续费 - 平台手续费 = 银行转账手续费
return bcsub($real_fee_price,$fee_price , 2);
}
public function getStatusList() public function getStatusList()
@ -275,11 +286,16 @@ class UserwithdrawalLog extends BaseModel
public function withdrawalReview($id,$status,$reason="",$trans=false){ public function withdrawalReview($id,$status,$reason="",$trans=false){
//找到需要审核的提现记录 //找到需要审核的提现记录
$userwithdrawalLog = self::where('id',$id)->where('status',"=",'1')->find(); $userwithdrawalLog = self::where('id',$id)->where('status',"in",['1',"2"])->find();
if(!$userwithdrawalLog) throw new \Exception("提现记录不存在"); if(!$userwithdrawalLog) throw new \Exception("提现记录不存在");
if($userwithdrawalLog['status']!='1') throw new \Exception("已经审核的提现记录不能再审核"); // if($userwithdrawalLog['status']!='1') throw new \Exception("已经审核的提现记录不能再审核");
if(!in_array($status,['2','3'])) throw new \Exception("审核状态错误"); if(!in_array($status,['2','3'])) throw new \Exception("审核状态错误");
//状态一致
if($userwithdrawalLog['status']==$status) throw new \Exception("状态一致");
//已打款
if($userwithdrawalLog['withdrawal_status']=='3') throw new \Exception("已经打款提现记录不能再审核");
//不通过需要理由 //不通过需要理由
if($status=='3' && !$reason) throw new \Exception("审核不通过原因不能为空"); if($status=='3' && !$reason) throw new \Exception("审核不通过原因不能为空");
//判断逻辑 //判断逻辑
@ -294,6 +310,7 @@ class UserwithdrawalLog extends BaseModel
//更新状态 //更新状态
$userwithdrawalLog["status"] = '2'; $userwithdrawalLog["status"] = '2';
$userwithdrawalLog["withdrawal_status"] = '2'; $userwithdrawalLog["withdrawal_status"] = '2';
$userwithdrawalLog["reason"] = "";
$userwithdrawalLog["examinetime"] = time(); $userwithdrawalLog["examinetime"] = time();
$userwithdrawalLog->save(); $userwithdrawalLog->save();
//调用事件 //调用事件
@ -305,6 +322,7 @@ class UserwithdrawalLog extends BaseModel
//审核不通过 //审核不通过
//更新状态 //更新状态
$userwithdrawalLog["status"] = '3'; $userwithdrawalLog["status"] = '3';
$userwithdrawalLog["withdrawal_status"] = '1';
$userwithdrawalLog["reason"] = $reason; $userwithdrawalLog["reason"] = $reason;
$userwithdrawalLog["examinetime"] = time(); $userwithdrawalLog["examinetime"] = time();
$userwithdrawalLog->save(); $userwithdrawalLog->save();
@ -396,4 +414,26 @@ class UserwithdrawalLog extends BaseModel
/** 通用详情(后台api版本)
* @param $params
* @param $trans
* @return $this
* @throws \Exception
*/
public function detail($id,$show_field=[],$except_field=[]){
$row = $this->get($id);
if (!$row) {
throw new \Exception(__('No Results were found'));
}
if($show_field){
$row->visible($show_field);
}
if($except_field){
$row->hidden($except_field);
}
return $row;
}
} }

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -85,6 +85,8 @@ define(['jquery', 'bootstrap', 'backend', 'csmtable', 'form'], function ($, unde
{field: 'reason',visible:false, title: __('Reason'), operate: 'LIKE'}, {field: 'reason',visible:false, title: __('Reason'), operate: 'LIKE'},
{field: 'auth_reason',visible:false, title: __('售后申请原因'), operate: 'LIKE'}, {field: 'auth_reason',visible:false, title: __('售后申请原因'), operate: 'LIKE'},
{field: 'auth_status', title: __('Auth_status'), searchList: {"0":__('Auth_status 0'),"1":__('Auth_status 1'),"2":__('Auth_status 2')}, formatter: Table.api.formatter.status}, {field: 'auth_status', title: __('Auth_status'), searchList: {"0":__('Auth_status 0'),"1":__('Auth_status 1'),"2":__('Auth_status 2')}, formatter: Table.api.formatter.status},
{field: 'auth_num', title: __('售后申请人数'), operate:'BETWEEN'},
{field: 'auth_user_id',visible:false, title: __('Auth_user_id')}, {field: 'auth_user_id',visible:false, title: __('Auth_user_id')},
{field: 'auth_type',visible:false, title: __('Auth_type'), operate: 'LIKE'}, {field: 'auth_type',visible:false, title: __('Auth_type'), operate: 'LIKE'},
{field: 'refund_no',visible:false, title: __('Refund_no'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, {field: 'refund_no',visible:false, title: __('Refund_no'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},

View File

@ -37,8 +37,9 @@ define(['jquery', 'bootstrap', 'backend', 'csmtable', 'form'], function ($, unde
{field: 'fee_price', title: __('Fee_price'), operate:'BETWEEN'}, {field: 'fee_price', title: __('Fee_price'), operate:'BETWEEN'},
{field: 'real_price', title: __('Real_price'), operate:'BETWEEN'}, {field: 'real_price', title: __('Real_price'), operate:'BETWEEN'},
{field: 'real_have_price', title: __('Real_have_price'), operate:'BETWEEN'}, {field: 'real_have_price', title: __('Real_have_price'), operate:'BETWEEN'},
{field: 'real_fee_price', title: __('Real_fee_price'), operate:'BETWEEN'},
{field: 'bank_fee', title: __('各行转账手续费-额外'), operate:false},
{field: 'real_fee_price', title: __('Real_fee_price'), operate:'BETWEEN'},
{field: 'status', title: __('Status'), searchList: {"1":__('Status 1'),"2":__('Status 2'),"3":__('Status 3')}, formatter: Table.api.formatter.status}, {field: 'status', title: __('Status'), searchList: {"1":__('Status 1'),"2":__('Status 2'),"3":__('Status 3')}, formatter: Table.api.formatter.status},
@ -68,7 +69,7 @@ define(['jquery', 'bootstrap', 'backend', 'csmtable', 'form'], function ($, unde
{field: 'operate', title: __('Operate'), table: table , buttons: [ {field: 'operate', title: __('Operate'), table: table , buttons: [
{ {
name: 'auths', name: 'auths',
text: __('提现审核'), text: __('提现审核|重新审核'),
title: __('审核提现是否通过'), title: __('审核提现是否通过'),
classname: 'btn btn-xs btn-danger btn-magic btn-dialog', classname: 'btn btn-xs btn-danger btn-magic btn-dialog',
icon: 'fa fa-sign-in', icon: 'fa fa-sign-in',
@ -78,7 +79,7 @@ define(['jquery', 'bootstrap', 'backend', 'csmtable', 'form'], function ($, unde
}, },
visible: function (row) { visible: function (row) {
return row.status == '1'; return (row.status == '1' || row.status == '2') && row.withdrawal_status != '3';
} }
}, },
{ {

View File

@ -85,6 +85,7 @@ define(['jquery', 'bootstrap', 'backend', 'csmtable', 'form'], function ($, unde
{field: 'reason',visible:false, title: __('Reason'), operate: 'LIKE'}, {field: 'reason',visible:false, title: __('Reason'), operate: 'LIKE'},
{field: 'auth_reason',visible:false, title: __('售后申请原因'), operate: 'LIKE'}, {field: 'auth_reason',visible:false, title: __('售后申请原因'), operate: 'LIKE'},
{field: 'auth_status', title: __('Auth_status'), searchList: {"0":__('Auth_status 0'),"1":__('Auth_status 1'),"2":__('Auth_status 2')}, formatter: Table.api.formatter.status}, {field: 'auth_status', title: __('Auth_status'), searchList: {"0":__('Auth_status 0'),"1":__('Auth_status 1'),"2":__('Auth_status 2')}, formatter: Table.api.formatter.status},
{field: 'auth_num', title: __('售后申请人数'), operate:'BETWEEN'},
{field: 'auth_user_id',visible:false, title: __('Auth_user_id')}, {field: 'auth_user_id',visible:false, title: __('Auth_user_id')},
{field: 'auth_type',visible:false, title: __('Auth_type'), operate: 'LIKE'}, {field: 'auth_type',visible:false, title: __('Auth_type'), operate: 'LIKE'},
{field: 'refund_no',visible:false, title: __('Refund_no'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, {field: 'refund_no',visible:false, title: __('Refund_no'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},