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

5

... ... @@ -24,14 +24,7 @@ class PayController extends HomeBaseController
'payment' => config('wechat_config.payment'),
];
}
public function test(){
dump(cache('order'));
dump(cache('uid'));
dump(cache('data_user'));
dump(cache('result'));
dump(cache('result'));
dump(cache('result'));
}
/**
* 微信支付
... ... @@ -89,16 +82,13 @@ class PayController extends HomeBaseController
$out_trade_no=$notify->out_trade_no;
//查询订单信息
$order = Db::name('indent')->where('order_number',$out_trade_no)->find();
cache('order',$order);
if($successful){
$update['state'] = 2;
//更新订单状态为待发货
Db::name('indent')->where('order_number',$out_trade_no)->update($update);
$uid = $order['uid'];
cache('uid',$uid);
//查询当前用户身份
$data_user = Db::name('my_user')->where('uid',$uid)->find();
cache('data_user',$data_user);
if($order['indent_type'] == 1){
//如果是平台商品 学生购买
if($data_user['status'] == 4){
... ... @@ -123,6 +113,7 @@ class PayController extends HomeBaseController
Db::name('money_income') -> insert($data_money_income_salesman);
}
Db::name('my_user') -> where('uid',$salesman['uid']) -> setInc('balance',$money_salesman);
$money_teacher = 0;
foreach ($data_indent_goods as $key => $val){
$money_teacher += $val['price']*$val['number']*$money_ratio['teacher_ratio'];
... ...