Commit b132c6c2 authored by zw's avatar zw

bug

parent 7873e6de
......@@ -369,17 +369,21 @@ class DailyPaperService
/**
* 获取财务审核列表
* @param $daily_id
* @param int $agent_id
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
private function getCheckList($daily_id)
private function getCheckList($daily_id,$agent_id = 0)
{
$field = "id,daily_id,operation_id,operation_name,remark,alipay,tenpay,realty_pay,family_pay,private_bank,
cash,pos,other_bank,create_time,update_time";
$params["daily_id"] = $daily_id;
$params["is_del"] = 0;
if($agent_id > 0){
$params["operation_id"] = $agent_id;
}
return $this->oDailyLogModel->getDailyLogList($field, $params, 1, 15);
}
......@@ -412,6 +416,11 @@ class DailyPaperService
if (count($agent_info) <= 0 || ($agent_info[0]["level"] != 20 && $agent_info[0]["level"] != 40)) {
return ["code" => 101, "msg" => "经纪人信息错误"];
}
//todo 判断是否提交过,
$dailyInfo = $this->getDailyInfo($agent_id,$daily_date);
if(count($dailyInfo) > 0 ){
return ["code" => 101, "msg" => "请勿重复提交日报"];
}
$params = $this->dailyBin($agent_id, $agent_name, $daily_date, $alipay, $tenpay, $realty_pay,
$family_pay, $private_bank, $cash, $pos, $other_bank, $agent_info[0]["store_id"], $agent_info[0]["district_id"]);
return $this->oDailyModel->addDaily($params);
......@@ -467,6 +476,12 @@ class DailyPaperService
if (count($agent_info) <= 0 || ($agent_info[0]["level"] != 20 && $agent_info[0]["level"] != 40)) {
return ["code" => 101, "msg" => "经纪人信息错误"];
}
//todo 判断是否提交过,
$dailyInfo = $this->getCheckList($daily_id,$agent_id);
if(count($dailyInfo) > 0 ){
return ["code" => 101, "msg" => "您已经审核过了"];
}
$params = $this->dailyLogBin($daily_id, $agent_id, $agent_name, $daily_date, $alipay, $tenpay, $realty_pay,
$family_pay, $private_bank, $cash, $pos, $other_bank, $agent_info[0]["store_id"], $agent_info[0]["district_id"], $remark);
......
......@@ -37,6 +37,9 @@ class ODailyLog extends Model
if(isset($params["daily_id"])){
$where_["daily_id"] = $params["daily_id"];
}
if(isset($params["operation_id"])){
$where_["operation_id"] = $params["operation_id"];
}
if(isset($params["is_del"])){
$where_["is_del"] = $params["is_del"];
}
......
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