Commit 7039a433 authored by hujun's avatar hujun

费用报销-收款人

parent 869f3762
...@@ -83,15 +83,16 @@ class StoreFeeService ...@@ -83,15 +83,16 @@ class StoreFeeService
* @param int $id * @param int $id
* @param int $office_id * @param int $office_id
* @param int $status * @param int $status
* @param int $payee_agent_id
* @return int|string * @return int|string
* @throws \think\Exception * @throws \think\Exception
* @throws \think\exception\PDOException * @throws \think\exception\PDOException
*/ */
public function addApplyForPC($type, $fee_item, $total_fee, $agent_id, $store_id, $purpose, $site_id, $card_name, public function addApplyForPC($type, $fee_item, $total_fee, $agent_id, $store_id, $purpose, $site_id, $card_name,
$bank, $card_no, $count_time, $img_arr, $id = 0, $office_id = 0, $status = 0) $bank, $card_no, $count_time, $img_arr, $id = 0, $office_id = 0, $status = 0, $payee_agent_id = 0)
{ {
$arr = $this->applyForFeeBin($id, $type, $fee_item, $total_fee, $agent_id, $store_id, $purpose, $site_id, $card_name, $arr = $this->applyForFeeBin($id, $type, $fee_item, $total_fee, $agent_id, $store_id, $purpose, $site_id, $card_name,
$bank, $card_no, $count_time, $office_id, $status); $bank, $card_no, $count_time, $office_id, $status, 2, $payee_agent_id);
if ($id) { if ($id) {
$this->applyForFeeModel->updateData($arr, ['id' => $id]); $this->applyForFeeModel->updateData($arr, ['id' => $id]);
$feeId = $id; $feeId = $id;
...@@ -191,10 +192,11 @@ class StoreFeeService ...@@ -191,10 +192,11 @@ class StoreFeeService
* @param $office_id * @param $office_id
* @param $status * @param $status
* @param $source * @param $source
* @param $payee_agent_id
* @return array * @return array
*/ */
private function applyForFeeBin($id, $type, $fee_item, $total_fee, $agent_id, $store_id, $purpose, $site_id, $card_name, private function applyForFeeBin($id, $type, $fee_item, $total_fee, $agent_id, $store_id, $purpose, $site_id, $card_name,
$bank, $card_no, $count_time, $office_id, $status, $source = 0) $bank, $card_no, $count_time, $office_id, $status, $source = 0, $payee_agent_id = 0)
{ {
$arr = []; $arr = [];
if ($type) { if ($type) {
...@@ -233,6 +235,9 @@ class StoreFeeService ...@@ -233,6 +235,9 @@ class StoreFeeService
if ($source) { if ($source) {
$arr["source"] = $source; $arr["source"] = $source;
} }
if ($payee_agent_id) {
$arr["payee_agent_id"] = $payee_agent_id;
}
if ($count_time) { if ($count_time) {
$arr["count_time"] = $count_time; $arr["count_time"] = $count_time;
} elseif ($id <= 0 && !$count_time) { } elseif ($id <= 0 && !$count_time) {
......
...@@ -453,6 +453,7 @@ class StoreFee extends Basic ...@@ -453,6 +453,7 @@ class StoreFee extends Basic
'card_no' => "123123",//银行卡号 非必填 'card_no' => "123123",//银行卡号 非必填
'count_time' => "2019-07-01",//计入日期, pc后台的字段 非必填 'count_time' => "2019-07-01",//计入日期, pc后台的字段 非必填
'img_arr' => [],//数组模式 同收款一样 'img_arr' => [],//数组模式 同收款一样
'payee_agent_id'=>1'//收款人
);*/ );*/
$check_url = ltrim($this->request->baseUrl(), '/'); $check_url = ltrim($this->request->baseUrl(), '/');
$validate = new StoreFeeValidate(); $validate = new StoreFeeValidate();
...@@ -481,6 +482,7 @@ class StoreFee extends Basic ...@@ -481,6 +482,7 @@ class StoreFee extends Basic
$card_no = $params["card_no"]; $card_no = $params["card_no"];
$count_time = $params["count_time"]; $count_time = $params["count_time"];
$office_id = $params["office_id"]; $office_id = $params["office_id"];
$payee_agent_id = $params["payee_agent_id"];
$img_arr = isset($params["img_arr"]) ? json_decode($params["img_arr"], true) : ""; $img_arr = isset($params["img_arr"]) ? json_decode($params["img_arr"], true) : "";
if (!$img_arr && $check_url == 'index/addApplyFor') { if (!$img_arr && $check_url == 'index/addApplyFor') {
return $this->response("101", "请上传图片"); return $this->response("101", "请上传图片");
...@@ -499,7 +501,7 @@ class StoreFee extends Basic ...@@ -499,7 +501,7 @@ class StoreFee extends Basic
return $this->response("101", "办公室水电费每月只能提交一次"); return $this->response("101", "办公室水电费每月只能提交一次");
} }
$is_ok = $service_->addApplyForPC($type, $fee_item, $total_fee, $agent_id, $store_id, $purpose, $site_id, $card_name, $is_ok = $service_->addApplyForPC($type, $fee_item, $total_fee, $agent_id, $store_id, $purpose, $site_id, $card_name,
$bank, $card_no, $count_time, $img_arr, $id, $office_id, $status); $bank, $card_no, $count_time, $img_arr, $id, $office_id, $status, $payee_agent_id);
if ($is_ok > 0) { if ($is_ok > 0) {
$push = new PushMessageService(); $push = new PushMessageService();
$push->recordApplyForFeDistrict($agent_id, $this->userId); $push->recordApplyForFeDistrict($agent_id, $this->userId);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment