|
@@ -1480,4 +1480,60 @@ class Index extends Api
|
|
|
$finish_filename = date('Ymd') . '_' . config('cp_id') . '_userplaydata.finish';
|
|
|
error_log('', 3, './jiankang/' . $finish_filename);
|
|
|
}
|
|
|
+
|
|
|
+ //用户行为feedback
|
|
|
+ public function userfeedback() {
|
|
|
+ $type = input('type', '', 'trim'); //曝光display/播放play/点击click/订购order/搜索 search/收藏 fav
|
|
|
+ $itemid = input('itemid', '', 'trim'); //视频id,研究院推荐内容上报
|
|
|
+ $otherid = input('otherid', '', 'trim'); //视频id,非研究院推荐内容上报
|
|
|
+ $prodid = input('prodid', '', 'trim'); //订购行为必填;其余行为可选
|
|
|
+ $trace_id = input('trace_id', '', 'trim'); //大数据推荐内容有trace_id
|
|
|
+ $signal = input('signal', '', 'trim'); //所属板块编号,0异形、1头部、3电影,后续查看服务接口标识;非推荐内容所有行为为空;推荐内容所有行为必填
|
|
|
+ $pos = input('pos', '', 'trim'); //所在位置编号,从左至右第1、2…个推荐位; 非推荐内容所有行为为空;推荐内容所有行为必填
|
|
|
+ $play_duration = input('play_duration', 0, 'trim'); //单位毫秒,在播放结束时反馈该值
|
|
|
+
|
|
|
+ $url = 'http://jscp.agency.gitv.tv/v2/feedback';
|
|
|
+ $content['userid'] = $this->auth->mobile;
|
|
|
+ $content['type'] = $type;
|
|
|
+ if ($itemid) {
|
|
|
+ $content['itemid'] = config('cp_id') . '|' . $itemid;
|
|
|
+ }
|
|
|
+ if ($otherid) {
|
|
|
+ $content['otherid'] = config('cp_id') . '|' . $otherid;
|
|
|
+ }
|
|
|
+ if ($prodid) {
|
|
|
+ $content['prodid'] = $prodid;
|
|
|
+ }
|
|
|
+ if ($trace_id) {
|
|
|
+ $content['trace_id'] = 'v2_1_2_1000035_' . $this->auth->mobile . '_153672384859_123456_01';
|
|
|
+ } else {
|
|
|
+ $content['trace_id'] = '';
|
|
|
+ }
|
|
|
+ if ($signal) {
|
|
|
+ $content['signal'] = $signal;
|
|
|
+ } else {
|
|
|
+ $content['signal'] = '';
|
|
|
+ }
|
|
|
+ if ($pos) {
|
|
|
+ $content['pos'] = $pos;
|
|
|
+ } else {
|
|
|
+ $content['pos'] = '';
|
|
|
+ }
|
|
|
+ if ($play_duration) {
|
|
|
+ $content['play_duration'] = $play_duration;
|
|
|
+ } else {
|
|
|
+ $content['play_duration'] = '';
|
|
|
+ }
|
|
|
+ $content['operate_time'] = getMillisecond();
|
|
|
+
|
|
|
+ $content = http_build_query($content);
|
|
|
+ $url = $url . '?' . $content;
|
|
|
+
|
|
|
+ $rt = file_get_contents($url);
|
|
|
+ if (!$rt) {
|
|
|
+ $this->error('上报失败');
|
|
|
+ }
|
|
|
+
|
|
|
+ $this->success('上报成功');
|
|
|
+ }
|
|
|
}
|