Commit a401eeac a401eeacecbeec1c1d2cc8fdc9f8747d15daafa4 by lemon

*

1 parent 6d0f19ce
......@@ -147,6 +147,33 @@ class Contract extends BaseModel
}
/**
* 费用模式
* @param $cooperation_type
* @return string
*/
public static function getCooperation($cooperation_type)
{
switch ($cooperation_type) {
case 1:
return "一次性费用";
case 2:
return "分成";
case 3:
return '分成+预付';
case 5:
return '分成+一次性费用';
case 6:
return '抵扣成本后再分成';
case 7:
return '分成+预付+一次性费用';
case 8:
return '抵扣成本后分成+预付';
case 9:
return '一次性费用+抵扣成本后分成';
}
}
/**
* 一次性费用
* @param $right
* @return string
......
......@@ -239,7 +239,7 @@ class MusicianSongService extends Service
$contracts[$k] = [
'contract_id' => $item['contract_id'],
'files' => $files,
'cooperation_type' => $item['contract']['cooperation_type'],
'cooperation_type' => Contract::getCooperation($item['contract']['cooperation_type']),
'right' => Contract::getModel($item['contract']['cooperation_type'], $right),
'role' => array_unique($role),
'date_starting' => $item['contract']['date_starting'],
......@@ -247,6 +247,7 @@ class MusicianSongService extends Service
'limit' => is_null($item['contract']['date_ending']) ? '永久' : data_diff($item['contract']['date_starting'], $item['contract']['date_ending']),
'district' => Contract::getDistrict($item['contract']['district_id']),
'exclusive' => Contract::isExclusive($item['contract']['is_exclusive']),
'rights' => [['role'=>'作词作曲', 'right'=>'test'],['role'=>'演唱', 'right'=>'test']],
];
}
......
......@@ -33,7 +33,7 @@ class MusicianSongService extends Service
->join('songs_ip_exts as ext', 'songs_ip.id', '=', 'ext.song_ip_id')
->whereIn("songs.id", $song_ids)->whereNull("songs_ip.deleted_at")
->where('auth_channel', 1)->select(["songs.id", "songs_ip.id as sp_id", 'track_name',
'singer_name', 'album_name', 'public_time', 'track_version', 'favCnt', 'playCnt', 'downloadCnt',
'singer_name', 'album_name', 'track_cover', 'public_time', 'track_version', 'favCnt', 'playCnt', 'downloadCnt',
'favCnt_week', 'playCnt_week', 'downloadCnt_week', 'favCnt_years', 'playCnt_years', 'downloadCnt_years',
])
->when(filled($this->request->name), function (Builder $builder) {
......