|
@@ -22,8 +22,8 @@ class Unishop extends Api
|
|
if(!$apilimit){
|
|
if(!$apilimit){
|
|
$this->error('操作频繁');
|
|
$this->error('操作频繁');
|
|
}
|
|
}
|
|
- $pay_type = input('pay_type','alipay');
|
|
|
|
- $platform = input('platform','app');
|
|
|
|
|
|
+ $pay_type = input('pay_type','wechat');
|
|
|
|
+ $platform = input('platform','mini');
|
|
$orderid = input('order_id',0);
|
|
$orderid = input('order_id',0);
|
|
|
|
|
|
if(empty($orderid)){
|
|
if(empty($orderid)){
|
|
@@ -61,6 +61,9 @@ class Unishop extends Api
|
|
//订单改为已支付
|
|
//订单改为已支付
|
|
$order_update['pay_type'] = 2;
|
|
$order_update['pay_type'] = 2;
|
|
$order_update['have_paid'] = time();
|
|
$order_update['have_paid'] = time();
|
|
|
|
+
|
|
|
|
+ //水饺项目自动发货
|
|
|
|
+ $order_update['have_delivered'] = time();
|
|
$update_rs = Db::name('unishop_order')->where($map)->update($order_update);
|
|
$update_rs = Db::name('unishop_order')->where($map)->update($order_update);
|
|
if(!$update_rs){
|
|
if(!$update_rs){
|
|
Db::rollback();
|
|
Db::rollback();
|
|
@@ -101,6 +104,7 @@ class Unishop extends Api
|
|
'method' => $platform,
|
|
'method' => $platform,
|
|
'notifyurl' => config('pay_notify_url').'/api/unishop/order_notify_base/paytype/'.$pay_type,
|
|
'notifyurl' => config('pay_notify_url').'/api/unishop/order_notify_base/paytype/'.$pay_type,
|
|
'returnurl' => '',
|
|
'returnurl' => '',
|
|
|
|
+ 'openid' => $this->auth->wxmini_openid,
|
|
];
|
|
];
|
|
|
|
|
|
$res = Service::submitOrder($params);
|
|
$res = Service::submitOrder($params);
|
|
@@ -119,11 +123,19 @@ class Unishop extends Api
|
|
$this->success(1,$result);
|
|
$this->success(1,$result);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ public function test(){
|
|
|
|
+ $out_trade_no = input('out_trade_no','');
|
|
|
|
+ $paytype = 'wechat';
|
|
|
|
+ $rs = $this->order_notify_do($out_trade_no,$paytype);
|
|
|
|
+ echo '完成';
|
|
|
|
+ }
|
|
|
|
+
|
|
//异步回调对外方法
|
|
//异步回调对外方法
|
|
public function order_notify_base(){
|
|
public function order_notify_base(){
|
|
|
|
|
|
//验签
|
|
//验签
|
|
$paytype = input('paytype','alipay');
|
|
$paytype = input('paytype','alipay');
|
|
|
|
+ $paytype = 'wechat';
|
|
$notify_file = $this->notify_log_start($paytype);
|
|
$notify_file = $this->notify_log_start($paytype);
|
|
$pay = Service::checkNotify($paytype);
|
|
$pay = Service::checkNotify($paytype);
|
|
if (!$pay) {
|
|
if (!$pay) {
|
|
@@ -192,6 +204,9 @@ class Unishop extends Api
|
|
'have_paid'=>$nowtime,
|
|
'have_paid'=>$nowtime,
|
|
'pay_type' =>$paytype_enum[$paytype],
|
|
'pay_type' =>$paytype_enum[$paytype],
|
|
'pay_out_trade_no' =>$out_trade_no,
|
|
'pay_out_trade_no' =>$out_trade_no,
|
|
|
|
+
|
|
|
|
+ //水饺项目自动发货
|
|
|
|
+ 'have_delivered' => $nowtime
|
|
];
|
|
];
|
|
$rs_order = Db::name('unishop_order')->where('id',$orderInfo['table_id'])->update($update);
|
|
$rs_order = Db::name('unishop_order')->where('id',$orderInfo['table_id'])->update($update);
|
|
if($rs_order === false){
|
|
if($rs_order === false){
|