Commit 3b8d12d6 authored by zhuwei's avatar zhuwei

1

parent b3e4d235
......@@ -131,8 +131,8 @@ class Amercement extends Basic
if (true !== $checkResult) {
return $this->response("101", $checkResult);
}
$this->s_amercement->editAmercement($params['id'],$params,$params['edit_type'],$this->userId);//int(1)
return $this->response("200", "成功");
$res = $this->s_amercement->editAmercement($this->userId,$params['id'],$params,$params['edit_type'],$this->userId);//int(1)
return $this->response($res['code'], $res['msg']);
}
......
......@@ -12,6 +12,7 @@ namespace app\index\service;
use app\api_broker\service\PushMessageService;
use app\api_broker\service\RedisCacheService;
use app\api_broker\service\VipService;
use app\index\untils\ExportExcelUntil;
use app\model\AAgents;
use app\model\OAmercementImgModel;
......@@ -270,7 +271,7 @@ class AmercementService
$conditions =[];
$conditions["id"] = $id;
$field = "id,status,type,money,submit_agent_id,agent_id,remarks,create_time,operation_id,operation_time";
$field = "id,status,type,money,submit_agent_id,agent_id,remarks,create_time,operation_id,operation_time,forfeit_penalty";
$result = $this->m_amercement->getAmercementInfo($conditions, $field);
if(!$result){
......@@ -284,13 +285,14 @@ class AmercementService
$agent_data = $redis_cache->getRedisCache(2, $result['agent_id']);
$result['agent_name'] = $agent_data['name'];
if ($result['status'] == 0) {//待支付
$forfeit_penalty = 100;
$result['forfeit_penalty'] = $forfeit_penalty;//滞纳金
$result['money_sum'] = $forfeit_penalty + $result['money'];//罚款总金额
// $now_time = date("Y-m-d H:i:s", time());
// $forfeit_penalty = $this->updateForfeitPenalty($result['id'],$result['create_time'],$now_time,$result['money']);
// $result['forfeit_penalty'] = $forfeit_penalty;//滞纳金
$result['money_sum'] = $result['forfeit_penalty'] + $result['money'];//罚款总金额
} elseif ($result['status'] == 1) {//已支付
$forfeit_penalty = 100;
$result['forfeit_penalty'] = $forfeit_penalty;
$result['money_sum'] = $forfeit_penalty + $result['money'];
$result['pay_time'] = '';
$result['operation_name'] = '';
......@@ -306,17 +308,23 @@ class AmercementService
/**
* 更新数据
* @param $agent_id
* @param $id
* @param $params
* @param $edit_type
* @param $operation_id
* @return bool
* @return array
*/
public function editAmercement($id,$params,$edit_type,$operation_id)
public function editAmercement($agent_id,$id,$params,$edit_type,$operation_id)
{
switch ($edit_type) {
case 0 :
//0编辑
$vip = new VipService();//0:有权限 1:无权限
$is_can_edit = $vip->checkRule($agent_id, 'updateAmercement');
if($is_can_edit == 1){
return ['code'=>101,'msg'=>'暂无权限'];
}
$this->updateAmercement($id,$params);
break;
case 1 :
......@@ -327,7 +335,7 @@ class AmercementService
//2转已支付
$this->consummationAmercement($id,$operation_id);
}
return true;
return ['code'=>101,'msg'=>'成功'];
}
/**
......@@ -349,7 +357,7 @@ class AmercementService
$data['type'] = $params['type'];
if ((isset($params['remarks'])) && $params['remarks'])
$data['social_security_fee'] = $params['social_security_fee'];
$data['remarks'] = $params['remarks'];
if (!$data) {
return false;
......
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