...
|
...
|
@@ -123,32 +123,33 @@ class Store extends Api |
|
|
$param = (new StoreValidate())->goCheck('store_add');
|
|
|
$order_sn = $param['order_sn'] = get_order_sn();
|
|
|
$pay_data = [];
|
|
|
if($this->auth->end_time > time()) {
|
|
|
$param['status'] = 2;
|
|
|
} else {
|
|
|
// if($this->auth->end_time > time()) {
|
|
|
// $param['status'] = 2;
|
|
|
// } else {
|
|
|
$param['status'] = 1;
|
|
|
// 获取小程序配置
|
|
|
$options = \config('miniprogram.basic');
|
|
|
$app = new Application($options);
|
|
|
$payment = $app->payment;
|
|
|
// 获取支付参数
|
|
|
$attributes = [
|
|
|
'body' => '发布招募合伙人',
|
|
|
'out_trade_no' => $order_sn,
|
|
|
'total_fee' => 1, // $param['money'] * 100
|
|
|
'spbill_create_ip' => request()->ip(), // 可选,如不传该参数,SDK 将会自动获取相应 IP 地址
|
|
|
'notify_url' => url('index/ajax/notify',[],true,true), // 支付结果通知网址,如果不设置则会使用配置里的默认地址
|
|
|
'trade_type' => 'JSAPI', // 请对应换成你的支付方式对应的值类型
|
|
|
'openid' => Db::name('third')->where('user_id',$this->auth->id)->value('openid'),
|
|
|
];
|
|
|
$order = new Order($attributes);
|
|
|
$order_result = $payment->pay($order);
|
|
|
if($order_result['return_code'] == 'SUCCESS' && $order_result['result_code'] == 'SUCCESS') {
|
|
|
$prepayId = $order_result->prepay_id;
|
|
|
} else {
|
|
|
$this->error($order_result['return_msg']);
|
|
|
}
|
|
|
}
|
|
|
// // 获取小程序配置
|
|
|
// $options = \config('miniprogram.basic');
|
|
|
// $app = new Application($options);
|
|
|
// $payment = $app->payment;
|
|
|
// // 获取支付参数
|
|
|
// $attributes = [
|
|
|
// 'body' => '发布招募合伙人',
|
|
|
// 'out_trade_no' => $order_sn,
|
|
|
// 'total_fee' => 1, // $param['money'] * 100
|
|
|
// 'spbill_create_ip' => request()->ip(), // 可选,如不传该参数,SDK 将会自动获取相应 IP 地址
|
|
|
// 'notify_url' => url('index/ajax/notify',[],true,true), // 支付结果通知网址,如果不设置则会使用配置里的默认地址
|
|
|
// 'trade_type' => 'JSAPI', // 请对应换成你的支付方式对应的值类型
|
|
|
// 'openid' => Db::name('third')->where('user_id',$this->auth->id)->value('openid'),
|
|
|
// ];
|
|
|
// $order = new Order($attributes);
|
|
|
// $order_result = $payment->pay($order);
|
|
|
// if($order_result['return_code'] == 'SUCCESS' && $order_result['result_code'] == 'SUCCESS') {
|
|
|
// $prepayId = $order_result->prepay_id;
|
|
|
// $pay_data = $payment->configForJSSDKPayment($prepayId);
|
|
|
// } else {
|
|
|
// $this->error($order_result['return_msg']);
|
|
|
// }
|
|
|
// }
|
|
|
Db::startTrans();
|
|
|
$result = false;
|
|
|
$result_invite = true;
|
...
|
...
|
|