|
@@ -3,6 +3,7 @@
|
|
namespace App\Http\Controllers\Wap\Pay;
|
|
namespace App\Http\Controllers\Wap\Pay;
|
|
|
|
|
|
use App\Modules\Book\Services\ChapterService;
|
|
use App\Modules\Book\Services\ChapterService;
|
|
|
|
+use App\Modules\OfficialAccount\Services\OfficialAccountService;
|
|
use App\Modules\Subscribe\Services\OrderParamService;
|
|
use App\Modules\Subscribe\Services\OrderParamService;
|
|
use App\Modules\Subscribe\Services\SubstituteOrderService;
|
|
use App\Modules\Subscribe\Services\SubstituteOrderService;
|
|
use App\Modules\User\Services\ReadRecordService;
|
|
use App\Modules\User\Services\ReadRecordService;
|
|
@@ -220,7 +221,7 @@ class OrdersController extends Controller
|
|
$data['openid'] = $openid;//
|
|
$data['openid'] = $openid;//
|
|
|
|
|
|
$data['body'] = 'novel read';
|
|
$data['body'] = 'novel read';
|
|
- $official_name = $this->getSubscribeOfficialName($uid);
|
|
|
|
|
|
+ $official_name = $this->getSubscribeOfficialName($uid,$distribution_channel_id);
|
|
if ($official_name) {
|
|
if ($official_name) {
|
|
$data['body'] = '搜索公众号' . $official_name . ',请继续阅读';
|
|
$data['body'] = '搜索公众号' . $official_name . ',请继续阅读';
|
|
}
|
|
}
|
|
@@ -436,7 +437,7 @@ class OrdersController extends Controller
|
|
$data['price'] = $price;
|
|
$data['price'] = $price;
|
|
$data['create_ip'] = $ip;
|
|
$data['create_ip'] = $ip;
|
|
$data['body'] = 'novel read';
|
|
$data['body'] = 'novel read';
|
|
- $official_name = $this->getSubscribeOfficialName($uid);
|
|
|
|
|
|
+ $official_name = $this->getSubscribeOfficialName($uid,$distribution_channel_id);
|
|
if ($official_name) {
|
|
if ($official_name) {
|
|
$data['body'] = '搜索公众号' . $official_name . ',请继续阅读';
|
|
$data['body'] = '搜索公众号' . $official_name . ',请继续阅读';
|
|
}
|
|
}
|
|
@@ -533,16 +534,16 @@ class OrdersController extends Controller
|
|
$pay_info = $wechatPay->send($data);
|
|
$pay_info = $wechatPay->send($data);
|
|
\Log::info('send ok-------------------');
|
|
\Log::info('send ok-------------------');
|
|
|
|
|
|
- // 注册动作-》创建订单
|
|
|
|
- $action_type = 'CreateOrder';
|
|
|
|
- $param = [
|
|
|
|
- 'openid' => isset($openid)?$openid:'0',
|
|
|
|
- 'uid' =>isset($uid)?$uid:'0',
|
|
|
|
- 'order_sn' => isset($trade_no)?$trade_no:'0',
|
|
|
|
- 'amount' => isset($price)?$price:'0',
|
|
|
|
|
|
+ // 注册动作-》创建订单
|
|
|
|
+ $action_type = 'CreateOrder';
|
|
|
|
+ $param = [
|
|
|
|
+ 'openid' => isset($openid)?$openid:'0',
|
|
|
|
+ 'uid' =>isset($uid)?$uid:'0',
|
|
|
|
+ 'order_sn' => isset($trade_no)?$trade_no:'0',
|
|
|
|
+ 'amount' => isset($price)?$price:'0',
|
|
];
|
|
];
|
|
- \Log::info('FUCK_PALMPAYV2');
|
|
|
|
- UserService::PushUserActionToQueue($action_type,$distribution_channel_id,$param);
|
|
|
|
|
|
+ \Log::info('FUCK_PALMPAYV2');
|
|
|
|
+ UserService::PushUserActionToQueue($action_type,$distribution_channel_id,$param);
|
|
|
|
|
|
|
|
|
|
return $pay_info;
|
|
return $pay_info;
|
|
@@ -1201,12 +1202,12 @@ class OrdersController extends Controller
|
|
Log::info($e);
|
|
Log::info($e);
|
|
}
|
|
}
|
|
|
|
|
|
- // 注册动作-》回调订单
|
|
|
|
- $action_type = 'CallBackOrder';
|
|
|
|
- $param = [
|
|
|
|
- 'order_sn' => isset($trade_no)?$trade_no:'0',
|
|
|
|
- 'openid' => isset($uid)?$uid:'0',// 没有openid,用uid写log
|
|
|
|
- ];
|
|
|
|
|
|
+ // 注册动作-》回调订单
|
|
|
|
+ $action_type = 'CallBackOrder';
|
|
|
|
+ $param = [
|
|
|
|
+ 'order_sn' => isset($trade_no)?$trade_no:'0',
|
|
|
|
+ 'openid' => isset($uid)?$uid:'0',// 没有openid,用uid写log
|
|
|
|
+ ];
|
|
UserService::PushUserActionToQueue($action_type,$distribution_channel_id,$param);
|
|
UserService::PushUserActionToQueue($action_type,$distribution_channel_id,$param);
|
|
|
|
|
|
}
|
|
}
|
|
@@ -1495,7 +1496,7 @@ class OrdersController extends Controller
|
|
return DB::table('force_subscribe_users')->where('uid',$uid)->where('is_subscribed', 1)->get();
|
|
return DB::table('force_subscribe_users')->where('uid',$uid)->where('is_subscribed', 1)->get();
|
|
}
|
|
}
|
|
|
|
|
|
- public function getSubscribeOfficialName($uid)
|
|
|
|
|
|
+ public function getSubscribeOfficialName($uid,$distribution_channel_id)
|
|
{
|
|
{
|
|
$subscribe = $this->getSubscribe($uid);
|
|
$subscribe = $this->getSubscribe($uid);
|
|
if ($subscribe && isset($subscribe->appid)) {
|
|
if ($subscribe && isset($subscribe->appid)) {
|
|
@@ -1504,6 +1505,10 @@ class OrdersController extends Controller
|
|
return $official->nickname;
|
|
return $official->nickname;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ $res = OfficialAccountService::canUseOfficialAccountByChannelId(compact('distribution_channel_id'));
|
|
|
|
+ if (isset($res->nickname) && !empty($res->nickname)) {
|
|
|
|
+ return $res->nickname;
|
|
|
|
+ }
|
|
return '';
|
|
return '';
|
|
}
|
|
}
|
|
|
|
|