|
|
@@ -63,8 +63,10 @@ class Platform extends Api
|
|
|
public function user_share_count($uid){ // 统计用户各个短剧的版权数量
|
|
|
$map = []; // 初始化$map数组,避免未定义时的错误
|
|
|
$map['uid'] = $uid;
|
|
|
+ $timestamp = strtotime("-3 years");
|
|
|
$count = model('VideoShare')
|
|
|
->where($map)
|
|
|
+ ->where('createtime','>',$timestamp)
|
|
|
->group('vid')
|
|
|
->field('vid,sum(num) as count')
|
|
|
->select();
|
|
|
@@ -72,16 +74,16 @@ class Platform extends Api
|
|
|
}
|
|
|
// 查看各平台的收益情况
|
|
|
public function platform_income(){
|
|
|
- $map = []; // 初始化$map数组,避免未定义时的错误
|
|
|
+ $map = []; // 初始化查询条件数组
|
|
|
+ // 修正条件:使用正确的输入参数名 platform_id
|
|
|
if(input('platform_id', 0) > 0){
|
|
|
- // 明确指定uid所属的表(假设主表为video_share)
|
|
|
- $map['video_platform_record.platform_id'] = input('uid');
|
|
|
+ $map['video_platform_record.platform_id'] = input('platform_id', 0);
|
|
|
}
|
|
|
+ // vid 条件正确,无需修改
|
|
|
if(input('vid', 0) > 0){
|
|
|
- // 明确指定uid所属的表(假设主表为video_share)
|
|
|
- $map['video_platform_record.vid'] = input('vid');
|
|
|
+ $map['video_platform_record.vid'] = input('vid', 0);
|
|
|
}
|
|
|
- list( $offset, $limit) = $this->buildparams();
|
|
|
+ list($offset, $limit) = $this->buildparams();
|
|
|
$config = $this->config();
|
|
|
$list = model('VideoPlatformRecord')
|
|
|
->with('platform,videolist')
|
|
|
@@ -92,10 +94,10 @@ class Platform extends Api
|
|
|
->with('platform,videolist')
|
|
|
->where($map)
|
|
|
->count();
|
|
|
- $data = ['config' => $config, 'doctor' => $list,'total'=>$total];
|
|
|
+ $data = ['config' => $config, 'doctor' => $list, 'total' => $total];
|
|
|
$this->success('请求成功', $data);
|
|
|
-
|
|
|
}
|
|
|
+
|
|
|
// 每日分配各个短剧在不同平台的收益
|
|
|
public function platform_income_day(){
|
|
|
// 先获取所有短剧在不同平台的收益上下限
|