Commit de991dee authored by hujun's avatar hujun

删除税费

parent 4f1e1858
......@@ -1388,7 +1388,7 @@ class Finance extends Basic
return $this->response(101, '参数错误');
$m_taxes = new OTaxes();
$num = $m_taxes->updateTaxesById($this->params['taxes_id'],['is_del'=>1]);
$num = $m_taxes->updateTaxesById(['id_or_father_id'=>$this->params['taxes_id']],['is_del'=>1]);
if ($num > 0) {
$result['code'] = 200;
$result['msg'] = '删除成功';
......
......@@ -259,19 +259,24 @@ class OTaxes extends BaseModel
/**
* 修改信息
*
* @param $id
* @param $where
* @param $params
* @return OTaxes
*/
public function updateTaxesById($id, $params)
public function updateTaxesById($where, $params)
{
$update_dta = [];
if (isset($params['is_del'])) {
$update_dta['is_del'] = 1;
}
if (isset($where['id_or_father_id'])) {
$where_[] = ['EXP', 'id ='.$where['id_or_father_id']. ' or father_id='.$where['id_or_father_id']];
}
$update_dta["update_time"] = date("Y-m-d H:i:s", time());
$result = $this->where('id', $id)->update($update_dta);
$result = $this->where($where_)->update($update_dta);
return $result;
}
}
\ No newline at end of file
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