作者 lihan
1 个管道 的构建 通过 耗费 0 秒

充值卡测试

@@ -33,10 +33,11 @@ class ChargeController extends HomeBaseController @@ -33,10 +33,11 @@ class ChargeController extends HomeBaseController
33 { 33 {
34 $pay = new \Payment(); 34 $pay = new \Payment();
35 $return = $pay->handleNotify(); 35 $return = $pay->handleNotify();
  36 + session('op', $return['attach']);
36 if (!empty($return)) { 37 if (!empty($return)) {
37 $info = Db::name('charge')->where(['id' => $return['attach']])->find(); 38 $info = Db::name('charge')->where(['id' => $return['attach']])->find();
38 $balance = $info['denomination'] + $info['bonus']; 39 $balance = $info['denomination'] + $info['bonus'];
39 - session('op', $return['attach']); 40 +
40 Db::startTrans(); 41 Db::startTrans();
41 if (Db::name('user')->where(['openid' => $return['openid'], 'id' => session('user.id')])->setInc('balance', $balance)) { 42 if (Db::name('user')->where(['openid' => $return['openid'], 'id' => session('user.id')])->setInc('balance', $balance)) {
42 $data = [ 43 $data = [