Commit a401eeac a401eeacecbeec1c1d2cc8fdc9f8747d15daafa4 by lemon

*

1 parent 6d0f19ce
...@@ -147,6 +147,33 @@ class Contract extends BaseModel ...@@ -147,6 +147,33 @@ class Contract extends BaseModel
147 } 147 }
148 148
149 /** 149 /**
150 * 费用模式
151 * @param $cooperation_type
152 * @return string
153 */
154 public static function getCooperation($cooperation_type)
155 {
156 switch ($cooperation_type) {
157 case 1:
158 return "一次性费用";
159 case 2:
160 return "分成";
161 case 3:
162 return '分成+预付';
163 case 5:
164 return '分成+一次性费用';
165 case 6:
166 return '抵扣成本后再分成';
167 case 7:
168 return '分成+预付+一次性费用';
169 case 8:
170 return '抵扣成本后分成+预付';
171 case 9:
172 return '一次性费用+抵扣成本后分成';
173 }
174 }
175
176 /**
150 * 一次性费用 177 * 一次性费用
151 * @param $right 178 * @param $right
152 * @return string 179 * @return string
......
...@@ -239,7 +239,7 @@ class MusicianSongService extends Service ...@@ -239,7 +239,7 @@ class MusicianSongService extends Service
239 $contracts[$k] = [ 239 $contracts[$k] = [
240 'contract_id' => $item['contract_id'], 240 'contract_id' => $item['contract_id'],
241 'files' => $files, 241 'files' => $files,
242 'cooperation_type' => $item['contract']['cooperation_type'], 242 'cooperation_type' => Contract::getCooperation($item['contract']['cooperation_type']),
243 'right' => Contract::getModel($item['contract']['cooperation_type'], $right), 243 'right' => Contract::getModel($item['contract']['cooperation_type'], $right),
244 'role' => array_unique($role), 244 'role' => array_unique($role),
245 'date_starting' => $item['contract']['date_starting'], 245 'date_starting' => $item['contract']['date_starting'],
...@@ -247,6 +247,7 @@ class MusicianSongService extends Service ...@@ -247,6 +247,7 @@ class MusicianSongService extends Service
247 'limit' => is_null($item['contract']['date_ending']) ? '永久' : data_diff($item['contract']['date_starting'], $item['contract']['date_ending']), 247 'limit' => is_null($item['contract']['date_ending']) ? '永久' : data_diff($item['contract']['date_starting'], $item['contract']['date_ending']),
248 'district' => Contract::getDistrict($item['contract']['district_id']), 248 'district' => Contract::getDistrict($item['contract']['district_id']),
249 'exclusive' => Contract::isExclusive($item['contract']['is_exclusive']), 249 'exclusive' => Contract::isExclusive($item['contract']['is_exclusive']),
250 'rights' => [['role'=>'作词作曲', 'right'=>'test'],['role'=>'演唱', 'right'=>'test']],
250 ]; 251 ];
251 } 252 }
252 253
......
...@@ -33,7 +33,7 @@ class MusicianSongService extends Service ...@@ -33,7 +33,7 @@ class MusicianSongService extends Service
33 ->join('songs_ip_exts as ext', 'songs_ip.id', '=', 'ext.song_ip_id') 33 ->join('songs_ip_exts as ext', 'songs_ip.id', '=', 'ext.song_ip_id')
34 ->whereIn("songs.id", $song_ids)->whereNull("songs_ip.deleted_at") 34 ->whereIn("songs.id", $song_ids)->whereNull("songs_ip.deleted_at")
35 ->where('auth_channel', 1)->select(["songs.id", "songs_ip.id as sp_id", 'track_name', 35 ->where('auth_channel', 1)->select(["songs.id", "songs_ip.id as sp_id", 'track_name',
36 'singer_name', 'album_name', 'public_time', 'track_version', 'favCnt', 'playCnt', 'downloadCnt', 36 'singer_name', 'album_name', 'track_cover', 'public_time', 'track_version', 'favCnt', 'playCnt', 'downloadCnt',
37 'favCnt_week', 'playCnt_week', 'downloadCnt_week', 'favCnt_years', 'playCnt_years', 'downloadCnt_years', 37 'favCnt_week', 'playCnt_week', 'downloadCnt_week', 'favCnt_years', 'playCnt_years', 'downloadCnt_years',
38 ]) 38 ])
39 ->when(filled($this->request->name), function (Builder $builder) { 39 ->when(filled($this->request->name), function (Builder $builder) {
......