Commit 06fc668c authored by zhuwei's avatar zhuwei

新增-监督执行 ,监督执行-上传图片

parent e67b3eea
File deleted
......@@ -185,6 +185,72 @@ class Supervise extends Basic
return $this->response($data['status'], $data['msg'], $data['data']);
}
/**
* 新增-监督执行-上传图片
* @return \think\Response
*/
public function superviseUploadImg()
{
header('Access-Control-Allow-Origin:*');
set_time_limit(0);
$file = request()->file('image');
$data = [];
if ($file) {
$path = './resource' . DS . 'lib' . DS . 'Attachments'. DS . 'images'. DS . 'supervise';
$info = $file->validate([ 'size' => 10240000, 'ext' => 'jpg,png' ])//限制100m
->move($path);
if ($info) {
$img_path = $info->getSaveName(); //生成的图片路径
$static_path = $path . DS . $img_path; //生成图片的绝对路径
$image = \think\Image::open($static_path);
$image->thumb(500, 500)->save($static_path); //生成缩略图
$data = [
'name' => $img_path,
'path' => CK_IMG_URL .'images/supervise/' . $img_path
];
} else {
// 上传失败获取错误信息
return $this->response("101", $file->getError());
}
} else {
return $this->response("101", "没有该文件");
}
return $this->response("200", "request success", $data);
}
/**
* 新增-监督执行
* User: 朱伟
* Date: 2018/6/20
* Time: 13:10:33
*/
public function addSupervise(){
$params = $this->params;
/*
$params['agent_id']=78;//上传人
$params['agent_name']='C罗1';//经纪人名
$params['remark']='暂无';//备注
$params['img']='999999';//agent表id-当前登录用户id
$params['address']='地址';//地址
*/
if (!isset($params['agent_id']) || !isset($params['agent_name']) || !isset($params['remark']) || !isset($params['img'])) {
return $this->response("300", "参数不全", [ 'remote_groupid' => '' ]);
}
$res = $this->aSuperviseModel->saveSupervise($params['agent_id'],$params['agent_name'],$params['remark'],$params['img'],$params['address']);
//dump($UPhoneFollowPp->id);exit;
if ($res) {
return $this->response("200", "success!", $this->aSuperviseModel->id);
} else {
return $this->response("101", "失败!");
}
}
/**
* 监督执行列表
* User: 朱伟
......
......@@ -22,6 +22,20 @@ class ASuperviseModel extends Model
$this->db_model = Db::name($this->table);
}
public function saveSupervise($agent_id,$agent_name,$remark,$img,$address) {
$this->agent_id = $agent_id;
$this->agent_name = $agent_name;
$this->remark = $remark;
$this->img = $img;
$this->address = $address;
$this->create_time = date("Y-m-d h:i:sa", time());
$this->update_time = date("Y-m-d h:i:sa", time());
$this->save();
return $this->id;
}
public function findSuperviseList($pageNo = 1, $pageSize = 15, $order_ = 'id desc', $field, $params = '') {
$result = $this
......
......@@ -465,18 +465,13 @@ Route::group('broker', [
//user
'returnSearchCondition' => [ 'api_broker/User/returnSearchCondition', [ 'method' => 'get' ] ], //客户搜索条件
'searchUser' => [ 'api_broker/User/searchUser', [ 'method' => 'get|post' ] ], //客户搜索
'searchUser' => [ 'api_broker/User/searchUser', [ 'method' => 'get|post' ] ], //客户搜索
'superviseList' => [ 'api_broker/Supervise/superviseList', [ 'method' => 'POST|GET' ] ], //监督执行列表 朱伟 2018-06-15
'addSupervise' => [ 'api_broker/Supervise/addSupervise', [ 'method' => 'POST|GET' ] ], //新增-监督执行 朱伟 2018-06-20
'superviseUploadImg' => [ 'api_broker/Supervise/superviseUploadImg', [ 'method' => 'POST|GET' ] ], //监督执行-上传图片 朱伟 2018-06-20
'superviseList' => [ 'api_broker/Supervise/superviseList', [ 'method' => 'POST|GET' ] ], //监督执行列表 朱伟 2018-06-15
'housingResource' => [ 'api_broker/Performance/housingResource', [ 'method' => 'POST|GET' ] ], //获取房源list
'userResource' => [ 'api_broker/Performance/userResource', [ 'method' => 'POST|GET' ] ], //获取客源list
'followList' => [ 'api_broker/Performance/followList', [ 'method' => 'POST|GET' ] ], //报备list
'marchInList' => [ 'api_broker/Performance/marchInList', [ 'method' => 'POST|GET' ] ], //进场list
'paylogList' => [ 'api_broker/Performance/paylogList', [ 'method' => 'POST|GET' ] ], //收款list
'performanceList' => [ 'api_broker/Performance/performanceList', [ 'method' => 'POST|GET' ] ], //业绩list
]);
......
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