From e8ca587ad88a41ef1da06dd2ac606dc9c5733a3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=87?= Date: Thu, 30 May 2019 15:21:26 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E8=AF=B4=E5=88=B0=E5=BA=95=E6=98=AF?= =?UTF-8?q?=E5=BD=93=E6=97=B6=E5=B9=B4=E7=BA=AA=E5=B0=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- php/GameController.php | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 php/GameController.php diff --git a/php/GameController.php b/php/GameController.php new file mode 100644 index 0000000..f7d572a --- /dev/null +++ b/php/GameController.php @@ -0,0 +1,32 @@ +where('id',$id)->setDec('coin',5); + } + + /* 抓取概率在c端,游戏结束点击领奖 + */ + public function gameover() + { + $id = cmf_get_user_id(); + $coin = $this->request->param('coin'); + if ($coin != 0){ + Db::name('user')->where('id',$id)->setInc('coin', $coin); + } + } + + /* 说到底是同事年纪小(当时不满20) + * 给他讲不要相信接收的数据、给他讲抓取开始即结束,奈何心里只有+15 + */ + +} + -- Gitee From 87d098341cd62b303cf4c3bdfb60385ae3846cc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=87?= Date: Thu, 30 May 2019 15:53:16 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20GameController.php?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- php/GameController.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/php/GameController.php b/php/GameController.php index f7d572a..79054ad 100644 --- a/php/GameController.php +++ b/php/GameController.php @@ -5,7 +5,7 @@ use think\Db; class GameController extends AdminBaseController{ /* 又想起同事一个神操作 - * 抓红包小游戏,开始玩一次消耗5金币,抓到几个金币用户余额增加几金币 + * 大转盘小游戏,开始玩一次消耗5金币,转到几个金币用户余额增加几金币 */ public function gamestart() { @@ -13,19 +13,25 @@ class GameController extends AdminBaseController{ Db::name('user')->where('id',$id)->setDec('coin',5); } - /* 抓取概率在c端,游戏结束点击领奖 + /* 抓取概率在前端,游戏结束点击领奖 */ public function gameover() { $id = cmf_get_user_id(); $coin = $this->request->param('coin'); + if ($coin != 0){ Db::name('user')->where('id',$id)->setInc('coin', $coin); } + //给他当面演示注入coin=500以后,改成以下条件 + if ($coin != 0 && $coin <= 100){ //解释说100金币是能转到最大额的 T T + Db::name('user')->where('id',$id)->setInc('coin', $coin); + } } - /* 说到底是同事年纪小(当时不满20) - * 给他讲不要相信接收的数据、给他讲抓取开始即结束,奈何心里只有+15 + + /* 说到底是同事年纪小(当时不满21) + * 给他讲不要相信接收的数据、给他讲开始即结束,奈何心里只有+15 */ } -- Gitee From e0f75c1db089ee4a6bf6590678fabc06c278155e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=87?= Date: Thu, 30 May 2019 15:53:41 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E8=AF=B4=E5=88=B0=E5=BA=95=E6=98=AF?= =?UTF-8?q?=E5=B9=B4=E7=BA=AA=E5=A4=AA=E5=B0=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- php/GameController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/php/GameController.php b/php/GameController.php index 79054ad..cce204f 100644 --- a/php/GameController.php +++ b/php/GameController.php @@ -30,7 +30,7 @@ class GameController extends AdminBaseController{ } - /* 说到底是同事年纪小(当时不满21) + /* 说到底是年纪小(当时不满21) * 给他讲不要相信接收的数据、给他讲开始即结束,奈何心里只有+15 */ -- Gitee