Commit 7b2cc458 authored by hujun's avatar hujun

审核图片

parent 8c15ad8a
......@@ -45,7 +45,7 @@ class ApplyForCost extends Basic
if ($is_ok) {
$is_check = 1;
}
// $where['a.status'] = 0;
$where['a.status'] = 0;
$where['a.agent_id'] = $this->agentId;break;//店长查看提交
case 'broker/costListDistrict' :
$is_ok = $check_rule->checkRule($this->agentId, $check_url);
......
......@@ -6,16 +6,19 @@ namespace app\index\service;
use app\model\FApplyForFee;
use app\model\FApplyForFeeCheck;
use app\model\FImg;
class CostService
{
private $apply_model;
private $check_model;
private $f_img_model;
public function __construct()
{
$this->apply_model = new FApplyForFee();
$this->check_model = new FApplyForFeeCheck();
$this->f_img_model = new FImg();
}
/**
......@@ -64,6 +67,19 @@ class CostService
if ($num) {
try {
$id = $this->apply_model->updateData(['status'=>$params['status']], ['id'=>$cost_data['id']]);
if ($params['status'] == 4) {
foreach($params['img_name'] as $v) {
$img_arr = [
'img_id' => $id,
'img_type' => 2,
'img_name' => $v['img_name']
];
}
if (isset($img_arr)) {
$this->f_img_model->insertDataAll($img_arr);
}
}
} catch (\Exception $e) {
$result['msg'] = '修改申请记录失败'.$e->getMessage();
return $result;
......
......@@ -16,6 +16,13 @@ class FImg extends BaseModel
$this->db_ = Db::name($this->table);
}
/**
* @param $data
* @return int|string
*/
public function insertDataAll($data) {
return $this->db_->insertAll($data);
}
/**
* 新增数据
......
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