|
@@ -28,6 +28,11 @@ class QappBaiduReport extends BaseReport
|
|
|
//百度回传链接
|
|
|
$this->report_url = $user->link;
|
|
|
|
|
|
+ $version = $this->getReportVersion($user->uid);
|
|
|
+
|
|
|
+ if($version == 1){
|
|
|
+ $this->charge_event_type = 'pay_to_read';
|
|
|
+ }
|
|
|
//替换a_type的值
|
|
|
$this->getReplaceUrl('a_type',$this->charge_event_type);
|
|
|
|
|
@@ -64,16 +69,53 @@ class QappBaiduReport extends BaseReport
|
|
|
*/
|
|
|
protected function getBaiduAkey($uid)
|
|
|
{
|
|
|
+ try {
|
|
|
+ //获取派单平台配置
|
|
|
+ $qapp_send_orders = $this->getQappSendOrders($uid);
|
|
|
+
|
|
|
+ if(isset($qapp_send_orders->extra_config) && !empty($qapp_send_orders->extra_config)){
|
|
|
+
|
|
|
+ $extra_config = json_decode($qapp_send_orders->extra_config,true);
|
|
|
+
|
|
|
+ return isset($extra_config['baidu_akey']) ? $extra_config['baidu_akey'] : '';
|
|
|
+ }
|
|
|
+ return '';
|
|
|
+ } catch (\Exception $e) {
|
|
|
+ \Log::info('补传获取派单失败uid:' .$uid . 'error:' . $e->getMessage());
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取上报版本
|
|
|
+ * @param $uid
|
|
|
+ * @return int
|
|
|
+ */
|
|
|
+ protected function getReportVersion($uid)
|
|
|
+ {
|
|
|
+ $qapp_send_orders = $this->getQappSendOrders($uid);
|
|
|
+
|
|
|
+ if(isset($qapp_send_orders->report_version)){
|
|
|
+
|
|
|
+ return $qapp_send_orders->report_version;
|
|
|
+ }
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取派单
|
|
|
+ * @param $uid
|
|
|
+ * @return string
|
|
|
+ */
|
|
|
+ protected function getQappSendOrders($uid)
|
|
|
+ {
|
|
|
//获取派单id
|
|
|
$send_order_id = Order::where('uid',$uid)->value('send_order_id');
|
|
|
|
|
|
//获取派单平台配置
|
|
|
- $extra_config = QappSendOrders::where('send_order_id',$send_order_id)->value('extra_config');
|
|
|
- if(isset($extra_config) && !empty($extra_config)){
|
|
|
- $extra_config = json_decode($extra_config,true);
|
|
|
- return isset($extra_config['baidu_akey']) ? $extra_config['baidu_akey'] : '';
|
|
|
- }
|
|
|
- return '';
|
|
|
+ $extra_config = QappSendOrders::where('send_order_id',$send_order_id)->first();
|
|
|
+
|
|
|
+ return $extra_config ?? '';
|
|
|
}
|
|
|
|
|
|
/**
|