Commit d1156ff6 authored by hujun's avatar hujun

删除图片

parent eae217fa
...@@ -111,4 +111,26 @@ class StoreFee extends Basic ...@@ -111,4 +111,26 @@ class StoreFee extends Basic
} }
} }
/**
* 删除图片
*
* @return \think\Response
*/
public function delStoreFeeImage()
{
$code = 101;;
$msg = '';
if (empty($this->params['id_string'])) {
return $this->response($code, '参数错误');
}
$result = $this->service_->delImg($this->params);
if ($result['status'] != 'fail') {
$code = 200;
}
return $this->response($code, $msg);
}
} }
\ No newline at end of file
...@@ -157,9 +157,10 @@ class StoreFeeService ...@@ -157,9 +157,10 @@ class StoreFeeService
$img_data = $this->imgModel->findByAll('id,img_name', ['id'=>['in', $id_string]]); $img_data = $this->imgModel->findByAll('id,img_name', ['id'=>['in', $id_string]]);
$num = 0; $num = 0;
$path = ROOT_PATH . 'public/';
foreach($img_data as $v) { foreach($img_data as $v) {
$num += $this->imgModel->editData(['is_del'=>1], $v['id']); $num += $this->imgModel->editData(['is_del'=>1], $v['id']);
unlink($v['img_name']); @unlink($path.'static/chat_image/'.$v['img_name']);
} }
if ($num) { if ($num) {
......
...@@ -399,4 +399,28 @@ class StoreFee extends Basic ...@@ -399,4 +399,28 @@ class StoreFee extends Basic
} }
} }
/**
* 删除图片
*
* @return \think\Response
*/
public function delStoreFeeImage()
{
$code = 101;;
$msg = '';
if (empty($this->params['id_string'])) {
return $this->response($code, '参数错误');
}
$service_ = new StoreFeeService();
$result = $service_->delImg($this->params);
if ($result['status'] != 'fail') {
$code = 200;
}
return $this->response($code, $msg);
}
} }
\ No newline at end of file
...@@ -537,7 +537,7 @@ Route::group('index', [ ...@@ -537,7 +537,7 @@ Route::group('index', [
'checkCostThree/:check_status' => ['index/Cost/checkCost', ['method' => 'POST'], ['check_status' => 2]], //费用报销审核一审 'checkCostThree/:check_status' => ['index/Cost/checkCost', ['method' => 'POST'], ['check_status' => 2]], //费用报销审核一审
'checkCostFour/:check_status' => ['index/Cost/checkCost', ['method' => 'POST'], ['check_status' => 3]], //费用报销审核二审 'checkCostFour/:check_status' => ['index/Cost/checkCost', ['method' => 'POST'], ['check_status' => 3]], //费用报销审核二审
'checkCostFive/:check_status' => ['index/Cost/checkCost', ['method' => 'POST'], ['check_status' => 4]], //费用报销审核三审 'checkCostFive/:check_status' => ['index/Cost/checkCost', ['method' => 'POST'], ['check_status' => 4]], //费用报销审核三审
'delStoreFeeImage' => ['index/StoreFee/delStoreFeeImage', ['method' => 'POST']],//删除图片
'getCostDetailList' => ['index/CostDetail/getCostDetailList', ['method' => 'POST|GET']], 'getCostDetailList' => ['index/CostDetail/getCostDetailList', ['method' => 'POST|GET']],
'getCostDetailListExcel' => ['index/CostDetail/getCostDetailListExcel', ['method' => 'POST|GET']], 'getCostDetailListExcel' => ['index/CostDetail/getCostDetailListExcel', ['method' => 'POST|GET']],
'getCostInfo' => ['index/CostDetail/getCostInfo', ['method' => 'POST|GET']], 'getCostInfo' => ['index/CostDetail/getCostInfo', ['method' => 'POST|GET']],
......
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