Commit 07e3f9ee authored by hujun's avatar hujun

del

parent aca8b2a7
...@@ -2282,6 +2282,12 @@ class Finance extends Basic ...@@ -2282,6 +2282,12 @@ class Finance extends Basic
return $this->response(101, '参数错误'); return $this->response(101, '参数错误');
} }
$m_pay = new OPayLogModel();
$num = $m_pay->getCount(['bargain_id'=>$this->params['bargain_id'],'is_del'=>0]);
if ($num > 0 ) {
return $this->response(101, '存在收款,不能删除!');
}
$check = $this->updatePerformanceAll($this->params['bargain_id']); $check = $this->updatePerformanceAll($this->params['bargain_id']);
if ($check['status'] == 'fail') { if ($check['status'] == 'fail') {
return $this->response(101, '更新个人业绩失败,请重试!'); return $this->response(101, '更新个人业绩失败,请重试!');
......
...@@ -557,4 +557,8 @@ class OPayLogModel extends Model ...@@ -557,4 +557,8 @@ class OPayLogModel extends Model
public function sumPayLog(string $field, array $where) { public function sumPayLog(string $field, array $where) {
return $this->db_->where($where)->sum($field); return $this->db_->where($where)->sum($field);
} }
public function getCount($where) {
return $this->db_->where($where)->count('id');
}
} }
\ No newline at end of file
...@@ -1045,7 +1045,7 @@ define(['doT', 'text!temp/reportList_template_tpl.html', 'css!style/home.css', ' ...@@ -1045,7 +1045,7 @@ define(['doT', 'text!temp/reportList_template_tpl.html', 'css!style/home.css', '
bargain.getList(bargain.pageNo); bargain.getList(bargain.pageNo);
} }
} else { } else {
alert('获取失败!'); alert(data.msg);
} }
} }
}); });
......
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