Commit 805a2a2e authored by 蔡闯's avatar 蔡闯

添加招商信息接口

parent 40f6a587
...@@ -31,6 +31,32 @@ class Company extends Base ...@@ -31,6 +31,32 @@ class Company extends Base
return $this->returnJson([],'修改成功!'); return $this->returnJson([],'修改成功!');
} }
//编辑招商信息
public function changeBusInfo()
{
$save['address'] = Request::param('address');
$save['place'] = Request::param('place');
$save['content'] = json_encode(Request::param('content'));
$save['day'] = Request::param('day');
$save['week'] = Request::param('week');
$save['time_quantum'] = Request::param('time_quantum');
$res = Db::name('bus')->where(['id'=>1])->update($save);
if($res !== false) {
return $this->returnJson([],'修改成功!');
} else{
return $this->returnJson([],'修改失败!',400);
}
}
//获取招商信息
public function getBusInfo()
{
$res = Db::name('bus')->where(['id'=>1])->find();
$res['content'] = json_decode($res['content'],true);
return $this->returnJson($res);
}
......
...@@ -18,7 +18,6 @@ class Message extends Base ...@@ -18,7 +18,6 @@ class Message extends Base
foreach ($list as $k =>$v) { foreach ($list as $k =>$v) {
// $list[$k]['content'] = mb_substr($v['content'],0,50,'utf-8'); // $list[$k]['content'] = mb_substr($v['content'],0,50,'utf-8');
switch ($v['from']){ switch ($v['from']){
case 1: case 1:
$list[$k]['from'] = "客满了官网"; $list[$k]['from'] = "客满了官网";
break; break;
...@@ -31,9 +30,12 @@ class Message extends Base ...@@ -31,9 +30,12 @@ class Message extends Base
case 4: case 4:
$list[$k]['from'] = "睿者智能公众号"; $list[$k]['from'] = "睿者智能公众号";
break; break;
case 5:
$list[$k]['from'] = "睿者招商";
break;
} }
} }
$count =Db::name('message')->count(); $count = Db::name('message')->count();
$res['total'] = $count; $res['total'] = $count;
$res['data'] = changeField($list); $res['data'] = changeField($list);
return $this->returnJson($res,'success'); return $this->returnJson($res,'success');
......
...@@ -34,5 +34,15 @@ class Company extends BaseController ...@@ -34,5 +34,15 @@ class Company extends BaseController
return $this->returnJson($data); return $this->returnJson($data);
} }
//获取招商信息
public function getBusInfo()
{
$res = Db::name('bus')->where(['id'=>1])->find();
$res['content'] = json_decode($res['content'],true);
return $this->returnJson($res);
}
} }
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