Merge branch 'hotfix/payment_merch_bug' of wmtx/platform into release

支付商户规则配置bug
master
万盟天下 4 years ago committed by Gogs
commit 7128eadeb0

@ -1438,9 +1438,12 @@ class CompanyStatementController extends ThinkController
if ($company_ids) { if ($company_ids) {
$inside = M("promote_company",'tab_')->field("company_name")->where(['id'=>['in',$company_ids],'is_inside'=>1])->select(); $inside = M("promote_company",'tab_')->field("company_name")->where(['id'=>['in',$company_ids],'is_inside'=>1])->select();
$inside = implode(',',array_column($inside,'company_name')); if ($inside) {
$this->ajaxReturn(['status'=>0,'msg'=>$inside.'为内部公司不能添加特殊补点']); $inside = implode(',',array_column($inside,'company_name'));
$this->ajaxReturn(['status'=>0,'msg'=>$inside.'为内部公司不能添加特殊补点']);
}
} }

@ -22,7 +22,13 @@ class GameApiController extends Think {
public function verify() public function verify()
{ {
$service = new TestingResourceService(); $service = new TestingResourceService();
$batches = M('testing_resource_batch', 'tab_')->where(['verify_status' => 0])->select();
$gameIds = $service->getHasItfGameIds();
$map = ['verify_status' => 0];
if (count($gameIds) > 0) {
$map['game_id'] = ['in', $gameIds];
}
$batches = M('testing_resource_batch', 'tab_')->where($map)->select();
foreach ($batches as $batch) { foreach ($batches as $batch) {
$service->verify($batch); $service->verify($batch);
} }
@ -31,7 +37,14 @@ class GameApiController extends Think {
public function provide() public function provide()
{ {
$service = new TestingResourceService(); $service = new TestingResourceService();
$batches = M('testing_resource_batch', 'tab_')->where(['verify_status' => 1, 'provide_status' => 0])->select();
$gameIds = $service->getHasItfGameIds();
$map = ['verify_status' => 1, 'provide_status' => 0];
if (count($gameIds) > 0) {
$map['game_id'] = ['in', $gameIds];
}
$batches = M('testing_resource_batch', 'tab_')->where($map)->select();
foreach ($batches as $batch) { foreach ($batches as $batch) {
$service->provide($batch); $service->provide($batch);
} }

@ -414,7 +414,7 @@ class PaymentMerchantController extends ThinkController
$query = M('payment_rule', 'tab_')->where($conditions); $query = M('payment_rule', 'tab_')->where($conditions);
$countQuery = clone $query; $countQuery = clone $query;
$items = $query->order('id desc')->page($page, $row)->select(); $items = $query->order('start_time desc')->page($page, $row)->select();
$count = $countQuery->count(); $count = $countQuery->count();
$gameTypes = $gameService->getGameTypes(null, 'id,type_name'); $gameTypes = $gameService->getGameTypes(null, 'id,type_name');
@ -675,6 +675,13 @@ class PaymentMerchantController extends ThinkController
]); ]);
} }
if ($rule['start_time'] < strtotime(date('Y-m-d 23:59:59', time()))) {
$this->ajaxReturn([
'status' => 0,
'message' => '该记录不可删除,规则开始时间包含今天或今天之前的时间。'
]);
}
M('payment_rule', 'tab_')->where(['id' => $id])->delete(); M('payment_rule', 'tab_')->where(['id' => $id])->delete();
addOperationLog([ addOperationLog([
'op_type' => 2, 'op_type' => 2,

@ -453,7 +453,7 @@
//重算金额 //重算金额
$("#updateStatement").on("click",function(){ $("#updateStatement").on("click",function(){
var text = $("input:checkbox[name='ids[]']:checked").map(function(index,elem) { var text = $("input:checkbox[name='ids[]']:checked").map(function(index,elem) {
if($(elem).data("status") == 0 || $(elem).data("status") == 1 || $(elem).data("status") == -1 || $(elem).data("status") == -3){ if($(elem).data("status") == 0 || $(elem).data("status") == -1 || $(elem).data("status") == -3){
return $(elem).val(); return $(elem).val();
}else{ }else{
flag = true; flag = true;
@ -461,10 +461,10 @@
// return $(elem).val(); // return $(elem).val();
}).get().join(","); }).get().join(",");
if(text == ''){ if(text == ''){
layer.msg("<font style='color:white'>" + '无需要进行重新结算的结算单,仅[未申请发票][申请开票][审批拒绝][汇总审批撤回]状态可以进行重新结算' + "</font>"); layer.msg("<font style='color:white'>" + '无需要进行重新结算的结算单,仅[未汇总][申请开票][审批拒绝][汇总审批撤回]状态可以进行重新结算' + "</font>");
return; return;
} }
layer.confirm("重算结算金额会对结算单回退到未申请发票状态,请慎重处理,点击取消停止操作",{title:false}, function(index){ layer.confirm("重算结算金额会对结算单回退到未汇总状态,请慎重处理,点击取消停止操作",{title:false}, function(index){
_doReceived(); _doReceived();
layer.close(index); layer.close(index);
}); });

@ -70,7 +70,7 @@ class PaymentRuleService
} }
if ($length == 1) { if ($length == 1) {
$first = $repeatRules[0]; $first = $repeatRules[0];
if ($startTime <= $first['start_time'] && $endTime >= $last['end_time']) { if ($startTime <= $first['start_time'] && $endTime >= $first['end_time']) {
M('payment_rule', 'tab_')->where(['id' => $first['id']])->delete(); M('payment_rule', 'tab_')->where(['id' => $first['id']])->delete();
} elseif ($endTime < $first['end_time'] && $startTime <= $first['start_time']) { } elseif ($endTime < $first['end_time'] && $startTime <= $first['start_time']) {
M('payment_rule', 'tab_')->where(['id' => $first['id']])->save(['start_time' => $endTime + 1, 'update_time' => time()]); M('payment_rule', 'tab_')->where(['id' => $first['id']])->save(['start_time' => $endTime + 1, 'update_time' => time()]);

@ -555,4 +555,24 @@ class TestingResourceService
} }
return $resources; return $resources;
} }
public function getHasItfGameIds()
{
$gameSettings = $this->repository->getGameSettings();
$baseGameIds = [];
foreach ($gameSettings as $gameSetting) {
if ($gameSetting['has_itf'] == 1) {
$baseGameIds[] = $gameSetting['base_game_id'];
}
}
$baseGames = [];
if (count($baseGameIds) > 0) {
$baseGames = M('base_game', 'tab_')->where(['id' => ['in', $baseGameIds]])->select();
}
if (empty($baseGames)) {
return [];
} else {
return array_merge(array_column($baseGames, 'android_game_id'), array_column($baseGames, 'ios_game_id'));
}
}
} }
Loading…
Cancel
Save