结算记录调整,结算状态管理添加
This commit is contained in:
parent
ec5768e9cf
commit
6803e3aa59
@ -55,6 +55,11 @@ class Activity extends Backend
|
||||
$this->view->assign("platformList", $this->model->getPlatformList());
|
||||
$this->view->assign("platformListJson", json_encode($this->model->getPlatformList(), JSON_UNESCAPED_UNICODE));
|
||||
|
||||
$this->view->assign("settlestatusList", $this->model->getSettlestatusList());
|
||||
$this->view->assign("settlestatusListJson", json_encode($this->model->getSettlestatusList(), JSON_UNESCAPED_UNICODE));
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -8,10 +8,10 @@ return [
|
||||
'Status' => '结算状态',
|
||||
'Status 1' => '冻结中',
|
||||
'Set status to 1' => '设为冻结中',
|
||||
'Status 2' => '待结算',
|
||||
'Set status to 2' => '设为待结算',
|
||||
'Status 3' => '已结算',
|
||||
'Set status to 3' => '设为已结算',
|
||||
'Status 2' => '待体现',
|
||||
'Set status to 2' => '设为待体现',
|
||||
'Status 3' => '已体现',
|
||||
'Set status to 3' => '设为已体现',
|
||||
'Status -1' => '已关闭',
|
||||
'Set status to -1' => '设为已关闭',
|
||||
'Settletime' => '结算时间',
|
||||
|
@ -39,9 +39,29 @@ class Activity extends Model
|
||||
'auth_status_text',
|
||||
'auth_time_text',
|
||||
'show_text',
|
||||
'canceltime_text'
|
||||
'canceltime_text',
|
||||
'settlestatus_text',
|
||||
];
|
||||
|
||||
|
||||
public function getSettlestatusList()
|
||||
{
|
||||
//结算状态:1=未结算,2=结算中,3=已结算
|
||||
return ['1' => __('未结算'), '2' => __('结算中'), '3' => __('已结算')];
|
||||
}
|
||||
|
||||
|
||||
public function getSettlestatusTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : (isset($data['settlestatus']) ? $data['settlestatus'] : '');
|
||||
$list = $this->getSettlestatusList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public function getShowList()
|
||||
{
|
||||
return ['1' => __('Show 1'), '2' => __('Show 2')];
|
||||
|
@ -3,6 +3,13 @@
|
||||
<div class="panel-heading">
|
||||
{:build_heading(null,FALSE)}
|
||||
|
||||
<ul class="nav nav-tabs nav-custom3-condition">
|
||||
<li class="active"><a href="#t-all" data-value="" data-toggle="tab">{:__('不筛选结算状态')}</a></li>
|
||||
{foreach name="settlestatusList" item="vo"}
|
||||
<li class="{:$Think.get.settlestatus === (string)$key ? 'active' : ''}"><a href="#t-{$key}" data-value="{$key}" data-toggle="tab">{$vo}</a></li>
|
||||
{/foreach}
|
||||
</ul>
|
||||
|
||||
|
||||
<ul class="nav nav-tabs nav-custom2-condition">
|
||||
<li class="active"><a href="#t-all" data-value="" data-toggle="tab">{:__('不筛选渠道')}</a></li>
|
||||
@ -66,4 +73,5 @@
|
||||
<script >
|
||||
var cateListJson = {$cateListJson};
|
||||
var platformListJson = {$platformListJson};
|
||||
var settlestatusListJson = {$settlestatusListJson};
|
||||
</script>
|
||||
|
@ -65,6 +65,8 @@ class SettleLog extends Base
|
||||
$has_evaluate = $this->request->get('has_evaluate/d', 0); //搜索关键字
|
||||
// $type = $this->request->get('type/s', ''); //筛选学员和教练单
|
||||
|
||||
|
||||
// var_dump($user_id);
|
||||
try{
|
||||
//当前申请状态
|
||||
$res = $this->model::allList($user_id,$page, $limit,$keywords,$status,$activity_id,$params);
|
||||
|
@ -1236,7 +1236,8 @@ class Activity extends BaseModel
|
||||
|
||||
//将课程信息和课时信息同步到所有已下单的订单信息中
|
||||
self::orderInfoSync($id);
|
||||
|
||||
//检测活动状态
|
||||
$this->updateSettleStatus($id);
|
||||
|
||||
|
||||
if($trans){
|
||||
@ -1544,7 +1545,7 @@ class Activity extends BaseModel
|
||||
if($row["status"] == "5"){
|
||||
$time = time();
|
||||
//到达结算时间为结算中
|
||||
$settlement_time= $params["settlement_time"];
|
||||
$settlement_time= $row["settlement_time"];
|
||||
if($time >= $settlement_time){
|
||||
$params["settlestatus"] = '2';
|
||||
}else{
|
||||
|
@ -2121,6 +2121,7 @@ class Order extends BaseModel
|
||||
|
||||
|
||||
|
||||
|
||||
if($trans){
|
||||
self::commitTrans();
|
||||
}
|
||||
|
@ -390,23 +390,26 @@ class SettleLog extends BaseModel
|
||||
public static function getUserSettleInfo($user_id = 0)
|
||||
{
|
||||
//统计未入账未提现金额
|
||||
$expected_incoming_amount = 0.00;
|
||||
// $expected_incoming_amount = 0.00;
|
||||
//
|
||||
// $orders = Order::where("payprice",">",0) //支付单
|
||||
// ->where("pay_type",'wechat') //微信支付
|
||||
// ->where("sub_refundprice",">",0) //剩余未退大于0
|
||||
// ->where("user_id",$user_id) //当前活动
|
||||
// ->where("status","in",["-3","2","3","9","6"])
|
||||
// ->field("sub_refundprice,fee_price")
|
||||
// ->select();
|
||||
// foreach ($orders as $order){
|
||||
// //剩余金额大于手续费的订单,并且未插入此结算单的
|
||||
// $sub_refundprice = bcsub($order["sub_refundprice"],$order["fee_price"],2);
|
||||
// if($sub_refundprice > 0){
|
||||
// $expected_incoming_amount += $sub_refundprice;
|
||||
// }
|
||||
//
|
||||
// }
|
||||
|
||||
$orders = Order::where("payprice",">",0) //支付单
|
||||
->where("pay_type",'wechat') //微信支付
|
||||
->where("sub_refundprice",">",0) //剩余未退大于0
|
||||
->where("user_id",$user_id) //当前活动
|
||||
->where("status","in",["-3","2","3","9","6"])
|
||||
->field("sub_refundprice,fee_price")
|
||||
->select();
|
||||
foreach ($orders as $order){
|
||||
//剩余金额大于手续费的订单,并且未插入此结算单的
|
||||
$sub_refundprice = bcsub($order["sub_refundprice"],$order["fee_price"],2);
|
||||
if($sub_refundprice > 0){
|
||||
$expected_incoming_amount += $sub_refundprice;
|
||||
}
|
||||
$expected_incoming_amount = self::where("to_user_id",$user_id)->where("status",'1')->sum("settle_price");
|
||||
|
||||
}
|
||||
//统计已入账待提现金额
|
||||
$settled_amount = self::where("to_user_id",$user_id)->where("status",'2')->sum("settle_price");
|
||||
//统计累计真实收益金额
|
||||
@ -454,8 +457,8 @@ class SettleLog extends BaseModel
|
||||
|
||||
|
||||
}
|
||||
if (isset($whereData['status'])) $model = $model->where("{$alisa}status", 'in', $whereData['status']);
|
||||
if (isset($whereData['not_status'])) $model = $model->where("{$alisa}status", 'not in', $whereData['not_status']);
|
||||
if (isset($whereData['status']) && $whereData['status'] !=="" && $whereData['status'] !==null ) $model = $model->where("{$alisa}status", 'in', $whereData['status']);
|
||||
if (isset($whereData['not_status']) && $whereData['not_status'] !=="" && $whereData['not_status'] !==null ) $model = $model->where("{$alisa}status", 'not in', $whereData['not_status']);
|
||||
|
||||
|
||||
|
||||
|
25
application/manystoreapi/controller/school/NewActivity.php
Normal file
25
application/manystoreapi/controller/school/NewActivity.php
Normal file
@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace app\manystoreapi\controller\school;
|
||||
|
||||
use app\common\controller\ManystoreApiBase;
|
||||
use app\common\model\school\activity\Activity;
|
||||
|
||||
/**
|
||||
* 机构API后台:活动管理接口
|
||||
*/
|
||||
class NewActivity extends ManystoreApiBase
|
||||
{
|
||||
protected $layout = '';
|
||||
protected $model = null;
|
||||
|
||||
|
||||
public function _initialize()
|
||||
{
|
||||
parent::_initialize();
|
||||
//移除HTML标签
|
||||
// $this->request->filter('trim,strip_tags,htmlspecialchars');
|
||||
$this->model = new Activity;
|
||||
}
|
||||
|
||||
}
|
@ -45,6 +45,8 @@ define(['jquery', 'bootstrap', 'backend', 'csmtable', 'form'], function ($, unde
|
||||
{field: 'status', title: __('Status'), searchList: {"1":__('Status 1'),"2":__('Status 2'),"3":__('Status 3'),"4":__('Status 4'),"5":__('Status 5'),"-1":__('Status -1')}, 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: 'reason', title: __('Reason'), operate: 'LIKE'},
|
||||
|
||||
{field: 'settlestatus', title: __('结算状态'), searchList: settlestatusListJson, formatter: Table.api.formatter.status},
|
||||
// {field: 'address_city', title: __('Address_city'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
||||
// {field: 'cate_ids', title: __('Cate_ids'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
||||
|
||||
@ -197,7 +199,42 @@ define(['jquery', 'bootstrap', 'backend', 'csmtable', 'form'], function ($, unde
|
||||
Table.api.bindevent(table);
|
||||
|
||||
|
||||
$('.panel-heading .nav-custom3-condition a[data-toggle="tab"]', table.closest(".panel-intro")).on('shown.bs.tab', function (e) {
|
||||
var value = $(this).data("value");
|
||||
var options = table.bootstrapTable('getOptions');
|
||||
var queryParams = options.queryParams;
|
||||
options.pageNumber = 1;
|
||||
options.queryParams = function (params) {
|
||||
//这一行必须要存在,否则在点击下一页时会丢失搜索栏数据
|
||||
params = queryParams(params);
|
||||
|
||||
//如果希望追加搜索条件,可使用
|
||||
var filter = params.filter ? JSON.parse(params.filter) : {};
|
||||
var op = params.op ? JSON.parse(params.op) : {};
|
||||
if (value!=="") {
|
||||
//这里可以自定义多个筛选条件
|
||||
filter.settlestatus = value;
|
||||
op.settlestatus = '=';
|
||||
}else{
|
||||
//console.log("111111111111111111");
|
||||
//选全部时要移除相应的条件
|
||||
delete filter.settlestatus;
|
||||
delete op.settlestatus;
|
||||
}
|
||||
|
||||
params.filter = JSON.stringify(filter);
|
||||
params.op = JSON.stringify(op);
|
||||
|
||||
//如果希望忽略搜索栏搜索条件,可使用
|
||||
//params.filter = JSON.stringify(value?{admin_id: value}:{});
|
||||
//params.op = JSON.stringify(value?{admin_id: '='}:{});
|
||||
return params;
|
||||
};
|
||||
|
||||
table.trigger("uncheckbox");
|
||||
table.bootstrapTable('refresh', {pageNumber: 1});
|
||||
return false;
|
||||
});
|
||||
|
||||
//自定义Tab筛选条件
|
||||
$('.panel-heading .nav-custom-condition a[data-toggle="tab"]', table.closest(".panel-intro")).on('shown.bs.tab', function (e) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user