*
Showing
6 changed files
with
54 additions
and
10 deletions
| ... | @@ -16,8 +16,9 @@ class ErrorCode | ... | @@ -16,8 +16,9 @@ class ErrorCode |
| 16 | const ORDER_ILLEGAl = 40040; | 16 | const ORDER_ILLEGAl = 40040; |
| 17 | const ORDER_WITHDRAW_ERROR = 40041; | 17 | const ORDER_WITHDRAW_ERROR = 40041; |
| 18 | const ORDER_MONEY_ERROR = 40042; | 18 | const ORDER_MONEY_ERROR = 40042; |
| 19 | const WITHDRAW_PREPARE_ERROR = 40050; | 19 | const WITHDRAW_NO_RECORD = 40051; |
| 20 | const WITHDRAW_HANDLE_ERROR = 40051; | 20 | const WITHDRAW_HANDLE_ERROR = 40052; |
| 21 | |||
| 21 | 22 | ||
| 22 | /** | 23 | /** |
| 23 | * @var string[] | 24 | * @var string[] |
| ... | @@ -32,7 +33,7 @@ class ErrorCode | ... | @@ -32,7 +33,7 @@ class ErrorCode |
| 32 | self::ORDER_ILLEGAl => '提现订单有误', | 33 | self::ORDER_ILLEGAl => '提现订单有误', |
| 33 | self::ORDER_WITHDRAW_ERROR => '提现记录有误', | 34 | self::ORDER_WITHDRAW_ERROR => '提现记录有误', |
| 34 | self::ORDER_MONEY_ERROR => '提现金额有误', | 35 | self::ORDER_MONEY_ERROR => '提现金额有误', |
| 35 | self::WITHDRAW_PREPARE_ERROR=> '提现申请失败', | 36 | self::WITHDRAW_NO_RECORD => '未匹配有效提现记录', |
| 36 | self::WITHDRAW_HANDLE_ERROR => '提现操作失败', | 37 | self::WITHDRAW_HANDLE_ERROR => '提现操作失败', |
| 37 | ]; | 38 | ]; |
| 38 | 39 | ... | ... |
| ... | @@ -3,6 +3,7 @@ | ... | @@ -3,6 +3,7 @@ |
| 3 | namespace App\Http\Controllers\Musician; | 3 | namespace App\Http\Controllers\Musician; |
| 4 | 4 | ||
| 5 | use App\Http\Controllers\Controller; | 5 | use App\Http\Controllers\Controller; |
| 6 | use App\Http\Requests\Musician\MusicianWithdrawReceiptByNameRequest; | ||
| 6 | use App\Http\Requests\Musician\MusicianWithdrawReceiptRequest; | 7 | use App\Http\Requests\Musician\MusicianWithdrawReceiptRequest; |
| 7 | use App\Http\Requests\Musician\MusicianWithdrawRequest; | 8 | use App\Http\Requests\Musician\MusicianWithdrawRequest; |
| 8 | use App\Http\Requests\Musician\MusicianWithdrawStatusRequest; | 9 | use App\Http\Requests\Musician\MusicianWithdrawStatusRequest; |
| ... | @@ -30,6 +31,7 @@ class MusicianWithdrawController extends Controller | ... | @@ -30,6 +31,7 @@ class MusicianWithdrawController extends Controller |
| 30 | 31 | ||
| 31 | /** | 32 | /** |
| 32 | * 发票信息 | 33 | * 发票信息 |
| 34 | * @param MusicianWithdrawReceiptRequest $request | ||
| 33 | * @return \Illuminate\Http\JsonResponse | 35 | * @return \Illuminate\Http\JsonResponse |
| 34 | */ | 36 | */ |
| 35 | public function receipt(MusicianWithdrawReceiptRequest $request) | 37 | public function receipt(MusicianWithdrawReceiptRequest $request) |
| ... | @@ -38,6 +40,17 @@ class MusicianWithdrawController extends Controller | ... | @@ -38,6 +40,17 @@ class MusicianWithdrawController extends Controller |
| 38 | } | 40 | } |
| 39 | 41 | ||
| 40 | /** | 42 | /** |
| 43 | * 通过公司名称查询发票信息 | ||
| 44 | * @param MusicianWithdrawReceiptByNameRequest $request | ||
| 45 | * @return \Illuminate\Http\JsonResponse | ||
| 46 | */ | ||
| 47 | public function receiptByName(MusicianWithdrawReceiptByNameRequest $request) | ||
| 48 | { | ||
| 49 | return $this->musicianWithdrawService->receiptInfoByName(); | ||
| 50 | } | ||
| 51 | |||
| 52 | |||
| 53 | /** | ||
| 41 | * 提现修改状态 | 54 | * 提现修改状态 |
| 42 | * @return \Illuminate\Http\JsonResponse | 55 | * @return \Illuminate\Http\JsonResponse |
| 43 | */ | 56 | */ | ... | ... |
| ... | @@ -4,7 +4,6 @@ namespace App\Models\Legal; | ... | @@ -4,7 +4,6 @@ namespace App\Models\Legal; |
| 4 | 4 | ||
| 5 | use App\Models\BaseModel; | 5 | use App\Models\BaseModel; |
| 6 | use Illuminate\Database\Eloquent\Factories\HasFactory; | 6 | use Illuminate\Database\Eloquent\Factories\HasFactory; |
| 7 | use Illuminate\Database\Eloquent\Model; | ||
| 8 | 7 | ||
| 9 | /** | 8 | /** |
| 10 | * 进账收益流水 | 9 | * 进账收益流水 | ... | ... |
| ... | @@ -2,7 +2,9 @@ | ... | @@ -2,7 +2,9 @@ |
| 2 | 2 | ||
| 3 | namespace App\Services; | 3 | namespace App\Services; |
| 4 | 4 | ||
| 5 | use App\Helper\ErrorCode; | ||
| 5 | use App\Helper\Response; | 6 | use App\Helper\Response; |
| 7 | use App\Models\Legal\Company; | ||
| 6 | use App\Models\Legal\StakeholderIncomeByPayer; | 8 | use App\Models\Legal\StakeholderIncomeByPayer; |
| 7 | 9 | ||
| 8 | /** | 10 | /** |
| ... | @@ -12,7 +14,34 @@ use App\Models\Legal\StakeholderIncomeByPayer; | ... | @@ -12,7 +14,34 @@ use App\Models\Legal\StakeholderIncomeByPayer; |
| 12 | class MusicianWithdrawService extends Service | 14 | class MusicianWithdrawService extends Service |
| 13 | { | 15 | { |
| 14 | /** | 16 | /** |
| 15 | * 发票信息 | 17 | * 发票信息 - 通过名字 |
| 18 | * @return \Illuminate\Http\JsonResponse|mixed | ||
| 19 | */ | ||
| 20 | public function receiptInfoByName() | ||
| 21 | { | ||
| 22 | if (!StakeholderIncomeByPayer::query()->where(['sync_status'=>1, 'withdraw_status'=>0, 'identifier'=>$this->identifier->identifier])->count()) { | ||
| 23 | return Response::error(ErrorCode::WITHDRAW_NO_RECORD); | ||
| 24 | } | ||
| 25 | |||
| 26 | if ($receipt = Company::query()->where(['receipt_name'=>$this->request->input('name')])->first()) { | ||
| 27 | return Response::success([ | ||
| 28 | 'receipt_type'=>$receipt->company->receipt_type, | ||
| 29 | 'receipt_name'=>$receipt->company->receipt_name, | ||
| 30 | 'receipt_no' =>$receipt->company->receipt_no, | ||
| 31 | 'receipt_tel' =>$receipt->company->receipt_tel, | ||
| 32 | 'receipt_address'=>$receipt->company->receipt_address, | ||
| 33 | 'receipt_bank'=>$receipt->company->receipt_bank, | ||
| 34 | 'receipt_bank_no'=>$receipt->company->receipt_bank_no, | ||
| 35 | ]); | ||
| 36 | } else { | ||
| 37 | return Response::success(); | ||
| 38 | } | ||
| 39 | |||
| 40 | } | ||
| 41 | |||
| 42 | |||
| 43 | /** | ||
| 44 | * 发票信息 - 通过流水号 | ||
| 16 | * @return \Illuminate\Http\JsonResponse | 45 | * @return \Illuminate\Http\JsonResponse |
| 17 | */ | 46 | */ |
| 18 | public function receiptInfo() | 47 | public function receiptInfo() |
| ... | @@ -22,10 +51,8 @@ class MusicianWithdrawService extends Service | ... | @@ -22,10 +51,8 @@ class MusicianWithdrawService extends Service |
| 22 | StakeholderIncomeByPayer::query()->with('company:company_id,receipt_type,receipt_name,receipt_no,receipt_tel,receipt_address,receipt_bank,receipt_bank_no') | 51 | StakeholderIncomeByPayer::query()->with('company:company_id,receipt_type,receipt_name,receipt_no,receipt_tel,receipt_address,receipt_bank,receipt_bank_no') |
| 23 | ->where(['identifier'=>$this->identifier->identifier, 'sync_status'=>1])->whereIn('serial_no', $this->request->input('serial_no'))->select(['id', 'company_id', 'serial_no', 'busi_id'])->get()->map(function ($item) use (&$receipt) { | 52 | ->where(['identifier'=>$this->identifier->identifier, 'sync_status'=>1])->whereIn('serial_no', $this->request->input('serial_no'))->select(['id', 'company_id', 'serial_no', 'busi_id'])->get()->map(function ($item) use (&$receipt) { |
| 24 | 53 | ||
| 25 | if (!empty($item->company)) { | 54 | if (!empty($item->company->company_id)) { |
| 26 | $receipt[] = [ | 55 | $receipt[$item->company->company_id] = [ |
| 27 | 'serial_no' =>$item->serial_no, | ||
| 28 | 'busi_id' =>$item->busi_id, | ||
| 29 | 'receipt_type'=>$item->company->receipt_type, | 56 | 'receipt_type'=>$item->company->receipt_type, |
| 30 | 'receipt_name'=>$item->company->receipt_name, | 57 | 'receipt_name'=>$item->company->receipt_name, |
| 31 | 'receipt_no' =>$item->company->receipt_no, | 58 | 'receipt_no' =>$item->company->receipt_no, | ... | ... |
| ... | @@ -11,7 +11,8 @@ | ... | @@ -11,7 +11,8 @@ |
| 11 | "guzzlehttp/guzzle": "^7.0.1", | 11 | "guzzlehttp/guzzle": "^7.0.1", |
| 12 | "laravel/framework": "^8.40", | 12 | "laravel/framework": "^8.40", |
| 13 | "laravel/tinker": "^2.5", | 13 | "laravel/tinker": "^2.5", |
| 14 | "phpseclib/phpseclib": "~3.0" | 14 | "phpseclib/phpseclib": "~3.0", |
| 15 | "ext-json": "*" | ||
| 15 | }, | 16 | }, |
| 16 | "require-dev": { | 17 | "require-dev": { |
| 17 | "facade/ignition": "^2.5", | 18 | "facade/ignition": "^2.5", | ... | ... |
| ... | @@ -37,6 +37,9 @@ Route::group([], function (){ | ... | @@ -37,6 +37,9 @@ Route::group([], function (){ |
| 37 | 37 | ||
| 38 | //提现发票抬头 | 38 | //提现发票抬头 |
| 39 | Route::post('withdraw/receipt', 'MusicianWithdrawController@receipt'); | 39 | Route::post('withdraw/receipt', 'MusicianWithdrawController@receipt'); |
| 40 | //提现发票抬头 - 通过公司中文 | ||
| 41 | Route::post('withdraw/receipt_by_name', 'MusicianWithdrawController@receiptByName'); | ||
| 42 | |||
| 40 | //账单状态修改 | 43 | //账单状态修改 |
| 41 | Route::post('withdraw/status', 'MusicianWithdrawController@status'); | 44 | Route::post('withdraw/status', 'MusicianWithdrawController@status'); |
| 42 | 45 | ... | ... |
-
Please register or sign in to post a comment