diff --git a/app/common/controller/FinReceiptController.php b/app/common/controller/FinReceiptController.php index 4acf899..c80dc3a 100644 --- a/app/common/controller/FinReceiptController.php +++ b/app/common/controller/FinReceiptController.php @@ -2,6 +2,9 @@ namespace app\common\controller; use app\common\controller\BaseController; +use app\common\model\Country; +use app\common\model\SysAccount; +use app\common\model\SysCurrency; use app\common\traits\crud\CrudControllerTrait; use app\common\service\FinReceiptService; @@ -32,6 +35,12 @@ class FinReceiptController extends BaseController $data['arrived_at'] = date('Y-m-d H:i:s', $data['arrived_at']); if (isset($data['received_at'])) $data['received_at'] = date('Y-m-d H:i:s', $data['received_at']); + if (isset($data['account_id'])) //收款账号 + $data['account_name'] = SysAccount::where('id', $data['account_id'])->first()->account_name; + if (isset($data['country_id'])) //付款来源国家 + $data['country_name'] = Country::where('id', $data['currency_id'])->first()->cn_addr; + if (isset($data['currency_id'])) //付款币种 + $data['currency_name'] = SysCurrency::where('id', $data['currency_id'])->first()->currency_name; return $data; } @@ -51,6 +60,12 @@ class FinReceiptController extends BaseController $data['arrived_at'] = date('Y-m-d H:i:s', $data['arrived_at']); if (isset($data['received_at'])) $data['received_at'] = date('Y-m-d H:i:s', $data['received_at']); + if (isset($data['account_id'])) //收款账号 + $data['account_name'] = SysAccount::where('id', $data['account_id'])->first()->account_name; + if (isset($data['country_id'])) //付款来源国家 + $data['country_name'] = Country::where('id', $data['currency_id'])->first()->cn_addr; + if (isset($data['currency_id'])) //付款币种 + $data['currency_name'] = SysCurrency::where('id', $data['currency_id'])->first()->currency_name; return $data; } } \ No newline at end of file diff --git a/app/common/service/FinPaymentApplyService.php b/app/common/service/FinPaymentApplyService.php index 535d621..14b9d64 100644 --- a/app/common/service/FinPaymentApplyService.php +++ b/app/common/service/FinPaymentApplyService.php @@ -66,6 +66,7 @@ class FinPaymentApplyService $data['doc_user_id'] = $request->user->uid; $data['submit_files'] = json_encode($data['submit_files']); redis::set('stock_' . $data['doc_user_id'], json_encode($request->post('stock')), 'EX', 30); + unset($data['stock']); return $data; } @@ -75,12 +76,14 @@ class FinPaymentApplyService $data = [ 'payment_apply_id' => $res['id'], ]; - $stock = json_decode(redis::get('stock_' . $res['doc_user_id']), true); + $piStock = json_decode(redis::get('stock_' . $res['doc_user_id']), true); redis::del('stock' . $res['doc_user_id']); - foreach ($stock as $k => $v) { - $data['stock_id'] = $v['stock_id']; - $data['pi_no'] = $v['pi_on']; - FinPaymentStock::create($data); + foreach ($piStock as $stock) { + foreach ($stock['stock_id'] as $v) { + $data['stock_id'] = $v; + $data['pi_no'] = $stock['pi_on']; + FinPaymentStock::create($data); + } } } @@ -90,7 +93,6 @@ class FinPaymentApplyService return $data; } - /** * 生成唯一的付款申请编码 * 格式:PA + 日期 + 6位字母数字组合