From 72d222a64a1c88136312a5900d65278dd43adc56 Mon Sep 17 00:00:00 2001 From: zhengchanglong Date: Tue, 4 Feb 2020 17:19:13 +0800 Subject: [PATCH] =?UTF-8?q?CP=E5=88=86=E6=88=90=E6=AF=94=E4=BE=8B=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Admin/Controller/GameController.class.php | 8 +- Application/Admin/View/Game/edit.html | 97 ++++++++++++------- Data/update.sql | 4 + composer.lock | 13 +-- 4 files changed, 75 insertions(+), 47 deletions(-) diff --git a/Application/Admin/Controller/GameController.class.php b/Application/Admin/Controller/GameController.class.php index cd6962103..993f7b4b1 100644 --- a/Application/Admin/Controller/GameController.class.php +++ b/Application/Admin/Controller/GameController.class.php @@ -424,7 +424,7 @@ class GameController extends ThinkController $this->assign('data', $data); $this->assign('game_id', $id); - $game_ratio = M('cp_game_ratio', 'tab_')->where(array('is_del'=>"0","game_id"=>$id))->order('begin_total_amount asc')->select(); + $game_ratio = M('cp_game_ratio', 'tab_')->where(array('is_del'=>"0","game_id"=>$id))->order('id asc')->select(); $this->meta_title = '编辑游戏'; $this->m_title = '游戏列表'; @@ -861,7 +861,7 @@ class GameController extends ThinkController $map['game_id']= $game['id']; $updainfo = M('cp_game_ratio', 'tab_')->where($map)->find(); if($updainfo){ - M('cp_game_ratio', 'tab_')->where("id=%d",$updainfo['id'])->data(array("ratio"=>$data['game_ratio'],"begin_total_amount"=>$data['total_amount'],"update_time"=>time()))->save(); + M('cp_game_ratio', 'tab_')->where("id=%d",$updainfo['id'])->data(array("instanceof"=>$data['instanceof'],"ratio"=>$data['game_ratio'],"begin_total_amount"=>$data['total_amount'],"update_time"=>time()))->save(); } } }else{ @@ -872,10 +872,10 @@ class GameController extends ThinkController if($exis_info){ die(json_encode(array("result"=>"0","desc"=>"分成档位已存在"))); }else{ - $max_info = M('cp_game_ratio', 'tab_')->field("max(ratio) as max_ratio,max(begin_total_amount) as max_amount")->where("game_id=%d and is_del=0",$data['game_id'])->find(); + /*$max_info = M('cp_game_ratio', 'tab_')->field("max(ratio) as max_ratio,max(begin_total_amount) as max_amount")->where("game_id=%d and is_del=0",$data['game_id'])->find(); if($max_info['max_ratio'] >= $data['game_ratio'] || $max_info['max_amount']>=$data['total_amount']){ die(json_encode(array("result"=>"0","desc"=>"新增分成档位金额或分成比例需大于现有分成档位"))); - } + }*/ foreach ($relation_game_list as $game) { M('cp_game_ratio', 'tab_')->data(array("game_id"=>$game['id'],"ratio"=>$data['game_ratio'],"begin_total_amount"=>$data['total_amount'],"add_time"=>time(),"update_time"=>time()))->add(); } diff --git a/Application/Admin/View/Game/edit.html b/Application/Admin/View/Game/edit.html index 1f5e22e75..714f470e7 100644 --- a/Application/Admin/View/Game/edit.html +++ b/Application/Admin/View/Game/edit.html @@ -616,8 +616,12 @@ - CP流水大于等于 + CP总流水 + 分成比例 @@ -629,8 +633,12 @@ - CP流水大于等于 + CP总流水 + 分成比例 % @@ -2238,8 +2246,12 @@