MusicianUserService.php
1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?php
namespace App\Services;
use App\Helper\Response;
use App\Models\Legal\StakeholderBalance;
use App\Models\Legal\StakeholderBalanceByPayer;
use App\Models\Musician\AppCompany;
use App\Models\Musician\CashOutOrder;
use App\Traits\TaxReckon;
/**
* Class MusicianUserService
* @package App\Services
*/
class MusicianUserService extends Service
{
/**
* @return \Illuminate\Http\JsonResponse
*/
public function userInfo()
{
$user_ids = array_map(function ($v) {return intval($v);}, $this->request->input('user_ids',[]));
if (empty($user_ids)) return Response::success();
$user = AppCompany::query()->whereIn('company_id', $user_ids)->get(['company_id', 'company_name'])->keyBy('company_id');
return Response::success($user);
}
/**
* 通过名字获取公司信息
* @return \Illuminate\Http\JsonResponse
*/
public function getCompanyByName()
{
$ids = AppCompany::query()->where('company_name', 'like', "%{$this->request->input('name')}%")->pluck('company_name','company_id')->toArray();
return Response::success($ids);
}
}