获取项目名
Showing
2 changed files
with
20 additions
and
1 deletions
app/Models/Legal/Project.php
0 → 100644
| 1 | <?php | ||
| 2 | |||
| 3 | namespace App\Models\Legal; | ||
| 4 | |||
| 5 | use App\Models\BaseModel; | ||
| 6 | use Illuminate\Database\Eloquent\Factories\HasFactory; | ||
| 7 | use Illuminate\Database\Eloquent\SoftDeletes; | ||
| 8 | |||
| 9 | /** | ||
| 10 | * Class Project | ||
| 11 | * @package App\Models\Legal | ||
| 12 | */ | ||
| 13 | class Project extends BaseModel | ||
| 14 | { | ||
| 15 | use HasFactory,SoftDeletes; | ||
| 16 | |||
| 17 | } |
| ... | @@ -12,6 +12,7 @@ use App\Models\Legal\Treaty; | ... | @@ -12,6 +12,7 @@ use App\Models\Legal\Treaty; |
| 12 | use App\Models\Musician\AppCompany; | 12 | use App\Models\Musician\AppCompany; |
| 13 | use App\Models\Musician\AppCompanyUser; | 13 | use App\Models\Musician\AppCompanyUser; |
| 14 | use Illuminate\Database\Eloquent\Builder; | 14 | use Illuminate\Database\Eloquent\Builder; |
| 15 | use Illuminate\Http\Request; | ||
| 15 | use Qcloud\Cos\Client; | 16 | use Qcloud\Cos\Client; |
| 16 | 17 | ||
| 17 | /** | 18 | /** |
| ... | @@ -20,6 +21,7 @@ use Qcloud\Cos\Client; | ... | @@ -20,6 +21,7 @@ use Qcloud\Cos\Client; |
| 20 | */ | 21 | */ |
| 21 | class PropertyTrackService extends Service | 22 | class PropertyTrackService extends Service |
| 22 | { | 23 | { |
| 24 | |||
| 23 | /** | 25 | /** |
| 24 | * 歌曲文件列表 | 26 | * 歌曲文件列表 |
| 25 | * @return \Illuminate\Http\JsonResponse | 27 | * @return \Illuminate\Http\JsonResponse |
| ... | @@ -47,7 +49,7 @@ class PropertyTrackService extends Service | ... | @@ -47,7 +49,7 @@ class PropertyTrackService extends Service |
| 47 | $data = []; | 49 | $data = []; |
| 48 | 50 | ||
| 49 | //详情 | 51 | //详情 |
| 50 | if ($track = PropertyTrack::query()->where(['id'=>$this->request->input('track_id'), 'from'=>1])->first()) { | 52 | if ($track = PropertyTrack::query()->with('project:id,name')->where(['id'=>$this->request->input('track_id'), 'from'=>1])->first()) { |
| 51 | $user = AppCompany::query()->where(['company_id'=>$track->create_admin])->first(); | 53 | $user = AppCompany::query()->where(['company_id'=>$track->create_admin])->first(); |
| 52 | $track->setAttribute('submit_name', $user ? $user->company_name : ''); | 54 | $track->setAttribute('submit_name', $user ? $user->company_name : ''); |
| 53 | $data = $track; | 55 | $data = $track; | ... | ... |
-
Please register or sign in to post a comment