作者 郭鑫

微信支付调试

... ... @@ -10,6 +10,7 @@ namespace app\portal\controller;
use cmf\controller\HomeBaseController;
use think\Db;
use api\portal\model\OrderModel;
class NotifyController extends HomeBaseController
{
... ... @@ -37,15 +38,15 @@ class NotifyController extends HomeBaseController
if (!$where['order_sn']) {
$where['order_sn'] = $data['out_trade_no'];
}
$where['price'] = $data['total_fee']/100;
$user_licence_model = Db::name('UserLicence');
// $where['price'] = $data['total_fee']/100;
$where['price'] = 1;
$order_model = new OrderModel();
$info = [
'paytype'=>1,
'pay_time'=>time(),
'status'=>1,
'status'=>2,
'transaction_id'=>$data['transaction_id']
];
$results = $user_licence_model->where($where)->update($info);
$results = $order_model->where($where)->update($info);
if($results) {
$this->return_success();
}
... ...
<?php
/**
* Created by PhpStorm.
* User: DN
* Date: 2018/7/20
* Time: 20:22
*/
namespace app\portal\model;
use app\admin\model\RouteModel;
use think\Model;
class OrderModel extends Model
{
}
\ No newline at end of file
... ...