Commit 13112657 authored by hujun's avatar hujun

后台提交费用申请不需要总监审核

parent 34524d2a
...@@ -61,6 +61,45 @@ class StoreFeeService ...@@ -61,6 +61,45 @@ class StoreFeeService
return $feeId; return $feeId;
} }
/**
* 后台提交无需总监审核
*
* @param $type
* @param $fee_item
* @param $total_fee
* @param $agent_id
* @param $store_id
* @param $purpose
* @param $site_id
* @param $card_name
* @param $bank
* @param $card_no
* @param $count_time
* @param $img_arr
* @param int $id
* @param int $office_id
* @param int $status
* @return int|string
* @throws \app\model\Exception
*/
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)
{
$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);
if ($id) {
$this->applyForFeeModel->updateData($arr, ['id'=>$id]);
$feeId = $id;
} else {
$feeId = $this->applyForFeeModel->saveData($arr);
}
if ($feeId > 0 && !empty($img_arr)) {
$this->imgModel->addImgAll($feeId, 1, $img_arr);
}
return $feeId;
}
public function verifyType($type, $fee_item) public function verifyType($type, $fee_item)
{ {
switch ($type) { switch ($type) {
...@@ -101,10 +140,12 @@ class StoreFeeService ...@@ -101,10 +140,12 @@ class StoreFeeService
* @param $bank * @param $bank
* @param $card_no * @param $card_no
* @param $count_time * @param $count_time
* @param $office_id
* @param $status
* @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) $bank, $card_no, $count_time, $office_id, $status)
{ {
$arr = []; $arr = [];
...@@ -141,6 +182,9 @@ class StoreFeeService ...@@ -141,6 +182,9 @@ class StoreFeeService
if ($office_id) { if ($office_id) {
$arr["office_id"] = $office_id; $arr["office_id"] = $office_id;
} }
if ($status) {
$arr["status"] = $status;
}
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) {
......
...@@ -92,7 +92,7 @@ class Cost extends Basic ...@@ -92,7 +92,7 @@ class Cost extends Basic
if (isset($param['check_status'])) { if (isset($param['check_status'])) {
switch($param['check_status']) { switch($param['check_status']) {
case 0 : case 0 :
$where['type'] = 5; //店长账号提交的 需要总监和财务的三级审核 $where['a.type'] = 5; //店长账号提交的 需要总监和财务的三级审核
$where['a.status'] = 0;break; $where['a.status'] = 0;break;
case 1 : case 1 :
$where['a.status'] = 1;break; $where['a.status'] = 1;break;
......
...@@ -404,8 +404,8 @@ class StoreFee extends Basic ...@@ -404,8 +404,8 @@ class StoreFee extends Basic
return $this->response("101", "类型选择错误"); return $this->response("101", "类型选择错误");
} }
} }
$is_ok = $service_->addApplyFor($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); $bank, $card_no, $count_time, $img_arr, $id, $office_id, 1);
if ($is_ok > 0) { if ($is_ok > 0) {
return $this->response("200", "request success", []); return $this->response("200", "request success", []);
} else { } else {
......
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