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

充值卡测试

@@ -33,12 +33,10 @@ class ChargeController extends HomeBaseController @@ -33,12 +33,10 @@ 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']);  
37 if (!empty($return)) { 36 if (!empty($return)) {
38 $info = Db::name('charge')->where(['id' => $return['attach']])->find(); 37 $info = Db::name('charge')->where(['id' => $return['attach']])->find();
39 $balance = $info['denomination'] + $info['bonus']; 38 $balance = $info['denomination'] + $info['bonus'];
40 -  
41 - Db::startTrans(); 39 + //Db::startTrans();
42 if (Db::name('user')->where(['openid' => $return['openid'], 'id' => session('user.id')])->setInc('balance', $balance)) { 40 if (Db::name('user')->where(['openid' => $return['openid'], 'id' => session('user.id')])->setInc('balance', $balance)) {
43 $data = [ 41 $data = [
44 'user_id' => session('user.id'), 42 'user_id' => session('user.id'),
@@ -47,7 +45,7 @@ class ChargeController extends HomeBaseController @@ -47,7 +45,7 @@ class ChargeController extends HomeBaseController
47 'create_time' => time() 45 'create_time' => time()
48 ]; 46 ];
49 if (Db::name('my_wallet')->insert($data)) { 47 if (Db::name('my_wallet')->insert($data)) {
50 - Db::commit(); 48 + //Db::commit();
51 echo "<xml><return_code><![CDATA[SUCCESS]]></return_code><return_msg><![CDATA[OK]]></return_msg></xml>"; 49 echo "<xml><return_code><![CDATA[SUCCESS]]></return_code><return_msg><![CDATA[OK]]></return_msg></xml>";
52 exit(); 50 exit();
53 } else { 51 } else {
@@ -164,7 +164,6 @@ class CenterController extends HomeBaseController @@ -164,7 +164,6 @@ class CenterController extends HomeBaseController
164 */ 164 */
165 public function charge() 165 public function charge()
166 { 166 {
167 - echo session('op');  
168 $is_bonus = request()->param('is_bonus'); 167 $is_bonus = request()->param('is_bonus');
169 $where['is_on_sale'] = ['eq', 1]; 168 $where['is_on_sale'] = ['eq', 1];
170 $is_bonus = (empty($is_bonus)) ? 0 : 1; 169 $is_bonus = (empty($is_bonus)) ? 0 : 1;