|
|
@@ -60,7 +60,7 @@ class Platform extends Api
|
|
|
$data = ['config' => $config, 'doctor' => $list,'total'=>$total,'count' => $count];
|
|
|
$this->success('请求成功', $data);
|
|
|
}
|
|
|
- public function user_share_count($uid){
|
|
|
+ public function user_share_count($uid){ // 统计用户各个短剧的版权数量
|
|
|
$map = []; // 初始化$map数组,避免未定义时的错误
|
|
|
$map['uid'] = $uid;
|
|
|
$count = model('VideoShare')
|
|
|
@@ -70,10 +70,34 @@ class Platform extends Api
|
|
|
->select();
|
|
|
return $count;
|
|
|
}
|
|
|
-// 每个短剧更具贡献值分红
|
|
|
- public function dividend(){
|
|
|
+// 查看各平台的收益情况
|
|
|
+ public function platform_income(){
|
|
|
+ $map = []; // 初始化$map数组,避免未定义时的错误
|
|
|
+ if(input('uid', 0) > 0){
|
|
|
+ // 明确指定uid所属的表(假设主表为video_share)
|
|
|
+ $map['video_share.uid'] = input('uid');
|
|
|
+ }
|
|
|
+ if(input('vid', 0) > 0){
|
|
|
+ // 明确指定uid所属的表(假设主表为video_share)
|
|
|
+ $map['video_share.vid'] = input('vid');
|
|
|
+ }
|
|
|
|
|
|
}
|
|
|
-
|
|
|
+// 每日分配各个短剧在不同平台的收益
|
|
|
+ public function platform_income_day(){
|
|
|
+// 先获取所有短剧在不同平台的收益上下限
|
|
|
+ $list = model('VideoPlatform')->select();
|
|
|
+ foreach ($list as $k => $v){
|
|
|
+ $randomNumber = mt_rand($v['min'] * 100, $v['max'] * 100) / 100;
|
|
|
+ $up=[
|
|
|
+ 'vid'=>$v['vid'],
|
|
|
+ 'platform_id'=>$v['platform_id'],
|
|
|
+ 'num'=>$randomNumber,
|
|
|
+ 'createtime'=>time(),
|
|
|
+ ];
|
|
|
+ $id=Db::name('task')->insertGetId($up);
|
|
|
+ }
|
|
|
+ $this->success('分配完成');
|
|
|
+ }
|
|
|
|
|
|
}
|