分离钱包和提现
Showing
3 changed files
with
53 additions
and
27 deletions
| ... | @@ -8,6 +8,7 @@ use App\Http\Requests\Musician\MusicianWithdrawReceiptByNameRequest; | ... | @@ -8,6 +8,7 @@ use App\Http\Requests\Musician\MusicianWithdrawReceiptByNameRequest; |
| 8 | use App\Http\Requests\Musician\MusicianWithdrawReceiptRequest; | 8 | use App\Http\Requests\Musician\MusicianWithdrawReceiptRequest; |
| 9 | use App\Http\Requests\Musician\MusicianWithdrawRequest; | 9 | use App\Http\Requests\Musician\MusicianWithdrawRequest; |
| 10 | use App\Http\Requests\Musician\MusicianWithdrawStatusRequest; | 10 | use App\Http\Requests\Musician\MusicianWithdrawStatusRequest; |
| 11 | use App\Services\MusicianWalletService; | ||
| 11 | use App\Services\MusicianWithdrawService; | 12 | use App\Services\MusicianWithdrawService; |
| 12 | 13 | ||
| 13 | /** | 14 | /** |
| ... | @@ -19,15 +20,15 @@ class MusicianWalletController extends Controller | ... | @@ -19,15 +20,15 @@ class MusicianWalletController extends Controller |
| 19 | /** | 20 | /** |
| 20 | * @var MusicianWithdrawService | 21 | * @var MusicianWithdrawService |
| 21 | */ | 22 | */ |
| 22 | protected $musicianWithdrawService; | 23 | protected $musicianWalletService; |
| 23 | 24 | ||
| 24 | /** | 25 | /** |
| 25 | * MusicianWithdrawController constructor. | 26 | * MusicianWalletController constructor. |
| 26 | * @param MusicianWithdrawService $musicianWithdrawService | 27 | * @param MusicianWalletService $musicianWalletService |
| 27 | */ | 28 | */ |
| 28 | public function __construct(MusicianWithdrawService $musicianWithdrawService) | 29 | public function __construct(MusicianWalletService $musicianWalletService) |
| 29 | { | 30 | { |
| 30 | $this->musicianWithdrawService = $musicianWithdrawService; | 31 | $this->musicianWalletService = $musicianWalletService; |
| 31 | } | 32 | } |
| 32 | 33 | ||
| 33 | /** | 34 | /** |
| ... | @@ -36,7 +37,7 @@ class MusicianWalletController extends Controller | ... | @@ -36,7 +37,7 @@ class MusicianWalletController extends Controller |
| 36 | */ | 37 | */ |
| 37 | public function walletDetail(MusicianWalletDetailRequest $request) | 38 | public function walletDetail(MusicianWalletDetailRequest $request) |
| 38 | { | 39 | { |
| 39 | return $this->musicianWithdrawService->walletDetail(); | 40 | return $this->musicianWalletService->walletDetail(); |
| 40 | } | 41 | } |
| 41 | 42 | ||
| 42 | } | 43 | } | ... | ... |
app/Services/MusicianWalletService.php
0 → 100644
| 1 | <?php | ||
| 2 | |||
| 3 | namespace App\Services; | ||
| 4 | |||
| 5 | use App\Helper\CacheKeyTools; | ||
| 6 | use App\Helper\ErrorCode; | ||
| 7 | use App\Helper\RedisClient; | ||
| 8 | use App\Helper\Response; | ||
| 9 | use App\Models\Legal\Company; | ||
| 10 | use App\Models\Legal\Contract; | ||
| 11 | use App\Models\Legal\StakeholderBalanceByPayer; | ||
| 12 | use App\Models\Legal\StakeholderBalanceDetail; | ||
| 13 | use App\Models\Legal\StakeholderIncomeSyncApp; | ||
| 14 | use App\Models\Legal\StakeholderIncomeSyncAppDetails; | ||
| 15 | use App\Models\Legal\StakeholderPrepaid; | ||
| 16 | use App\Models\Legal\StakeholderSongCollate; | ||
| 17 | use Illuminate\Support\Facades\DB; | ||
| 18 | use Illuminate\Support\Facades\Log; | ||
| 19 | |||
| 20 | /** | ||
| 21 | * Class MusicianWalletService | ||
| 22 | * @package App\Services | ||
| 23 | */ | ||
| 24 | class MusicianWalletService extends Service | ||
| 25 | { | ||
| 26 | /** | ||
| 27 | * 返回账单详情 | ||
| 28 | * @return \Illuminate\Http\JsonResponse | ||
| 29 | */ | ||
| 30 | public function walletDetail() | ||
| 31 | { | ||
| 32 | $app = StakeholderIncomeSyncApp::query()->where(['serial_no'=>$this->request->input('serial_no'), 'sync_status'=>1])->first(); | ||
| 33 | if (empty($app)) return Response::error(ErrorCode::ORDER_NO_FOUND); | ||
| 34 | |||
| 35 | $collate = StakeholderSongCollate::query()->where([ | ||
| 36 | 'bills_id'=>$app->related_id, 'stakeholder_id'=>$app->stakeholder_id, 'subject_no'=>$app->subject_no | ||
| 37 | ])->select(['song_id', 'role', 'cost_amount', 'deduct_prepaid as deduct_amount', 'real_share_amount', 'name', 'singer']) | ||
| 38 | ->paginate($this->pageSize); | ||
| 39 | |||
| 40 | foreach ($collate as &$item) { | ||
| 41 | $item->setAttribute('role', Contract::transformRole($item->role)); | ||
| 42 | } | ||
| 43 | |||
| 44 | return Response::success($collate); | ||
| 45 | } | ||
| 46 | } |
| ... | @@ -24,27 +24,6 @@ use Illuminate\Support\Facades\Log; | ... | @@ -24,27 +24,6 @@ use Illuminate\Support\Facades\Log; |
| 24 | class MusicianWithdrawService extends Service | 24 | class MusicianWithdrawService extends Service |
| 25 | { | 25 | { |
| 26 | /** | 26 | /** |
| 27 | * 返回账单详情 | ||
| 28 | * @return \Illuminate\Http\JsonResponse | ||
| 29 | */ | ||
| 30 | public function walletDetail() | ||
| 31 | { | ||
| 32 | $app = StakeholderIncomeSyncApp::query()->where(['serial_no'=>$this->request->input('serial_no'), 'sync_status'=>1])->first(); | ||
| 33 | if (empty($app)) return Response::error(ErrorCode::ORDER_NO_FOUND); | ||
| 34 | |||
| 35 | $collate = StakeholderSongCollate::query()->where([ | ||
| 36 | 'bills_id'=>$app->related_id, 'stakeholder_id'=>$app->stakeholder_id, 'subject_no'=>$app->subject_no | ||
| 37 | ])->select(['song_id', 'role', 'cost_amount', 'deduct_prepaid as deduct_amount', 'real_share_amount', 'name', 'singer']) | ||
| 38 | ->paginate($this->pageSize); | ||
| 39 | |||
| 40 | foreach ($collate as &$item) { | ||
| 41 | $item->setAttribute('role', Contract::transformRole($item->role)); | ||
| 42 | } | ||
| 43 | |||
| 44 | return Response::success($collate); | ||
| 45 | } | ||
| 46 | |||
| 47 | /** | ||
| 48 | * 发票信息 - 通过名字 | 27 | * 发票信息 - 通过名字 |
| 49 | * @return \Illuminate\Http\JsonResponse|mixed | 28 | * @return \Illuminate\Http\JsonResponse|mixed |
| 50 | */ | 29 | */ | ... | ... |
-
Please register or sign in to post a comment