付款与收款
This commit is contained in:
@@ -2,9 +2,11 @@
|
||||
|
||||
namespace app\common\service;
|
||||
|
||||
use app\common\model\FinPaymentStock;
|
||||
use app\common\validate\FinPaymentApplyValidate;
|
||||
use app\common\traits\crud\CrudServiceTrait;
|
||||
use app\common\model\FinPaymentApply;
|
||||
use support\Redis;
|
||||
use support\Request;
|
||||
|
||||
class FinPaymentApplyService
|
||||
@@ -61,10 +63,27 @@ class FinPaymentApplyService
|
||||
public function beforeServiceStore($data, Request $request)
|
||||
{
|
||||
$data['apply_no'] = $this->generateUniqueApplyNo();
|
||||
$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')));
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
||||
public function afterServiceStore($res)
|
||||
{
|
||||
$data = [
|
||||
'payment_apply_id' => $res['id'],
|
||||
];
|
||||
$stock = json_decode(redis::get('stock'.$res['doc_user_id']), true);
|
||||
redis::del('stock');
|
||||
foreach ($stock as $k => $v) {
|
||||
$data['stock_id'] = $v['stock_id'];
|
||||
$data['pi_no'] = $v['pi_on'];
|
||||
FinPaymentStock::create($data);
|
||||
}
|
||||
}
|
||||
|
||||
public function beforeServiceUpdate($data, Request $request)
|
||||
{
|
||||
$data['submit_files'] = json_encode($data['submit_files']);
|
||||
|
||||
Reference in New Issue
Block a user