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

充值卡测试

... ... @@ -33,12 +33,10 @@ class ChargeController extends HomeBaseController
{
$pay = new \Payment();
$return = $pay->handleNotify();
session('op', $return['attach']);
if (!empty($return)) {
$info = Db::name('charge')->where(['id' => $return['attach']])->find();
$balance = $info['denomination'] + $info['bonus'];
Db::startTrans();
//Db::startTrans();
if (Db::name('user')->where(['openid' => $return['openid'], 'id' => session('user.id')])->setInc('balance', $balance)) {
$data = [
'user_id' => session('user.id'),
... ... @@ -47,7 +45,7 @@ class ChargeController extends HomeBaseController
'create_time' => time()
];
if (Db::name('my_wallet')->insert($data)) {
Db::commit();
//Db::commit();
echo "<xml><return_code><![CDATA[SUCCESS]]></return_code><return_msg><![CDATA[OK]]></return_msg></xml>";
exit();
} else {
... ...
... ... @@ -164,7 +164,6 @@ class CenterController extends HomeBaseController
*/
public function charge()
{
echo session('op');
$is_bonus = request()->param('is_bonus');
$where['is_on_sale'] = ['eq', 1];
$is_bonus = (empty($is_bonus)) ? 0 : 1;
... ...