...
|
...
|
@@ -43,11 +43,13 @@ class AdminLightController extends AdminBaseController |
|
|
*/
|
|
|
public function index()
|
|
|
{
|
|
|
cmf_get_current_admin_id();
|
|
|
//接收搜索参数
|
|
|
$param = $this->request->param();
|
|
|
//添加搜索条件
|
|
|
$where = [];
|
|
|
if (cmf_get_current_admin_id()!=1){
|
|
|
$where['t.user_id']=cmf_get_current_admin_id();
|
|
|
};
|
|
|
$keyword = empty($param['number']) ? '' : $param['number'];
|
|
|
if (!empty($keyword)) {
|
|
|
$where['l.number'] = ['like', "%$keyword%"];
|
...
|
...
|
@@ -105,7 +107,12 @@ class AdminLightController extends AdminBaseController |
|
|
*/
|
|
|
public function add()
|
|
|
{
|
|
|
$address = Db::name('temple')->field('address')->distinct('true')->select();
|
|
|
$where = [];
|
|
|
if (cmf_get_current_admin_id()!=1){
|
|
|
$where['user_id']=cmf_get_current_admin_id();
|
|
|
};
|
|
|
|
|
|
$address = Db::name('temple')->where($where)->field('address')->distinct('true')->select();
|
|
|
$this->assign('address', $address);
|
|
|
return $this->fetch();
|
|
|
}
|
...
|
...
|
@@ -115,7 +122,12 @@ class AdminLightController extends AdminBaseController |
|
|
public function getTemple()
|
|
|
{
|
|
|
$address = $this->request->param('address');
|
|
|
$temple = Db::name('temple')->where('address', $address)->select()->toJson();
|
|
|
$where = [];
|
|
|
if (cmf_get_current_admin_id()!=1){
|
|
|
$where['user_id']=cmf_get_current_admin_id();
|
|
|
};
|
|
|
$where['address']=$address;
|
|
|
$temple = Db::name('temple')->where($where)->select()->toJson();
|
|
|
return $temple;
|
|
|
}
|
|
|
|
...
|
...
|
@@ -222,6 +234,10 @@ class AdminLightController extends AdminBaseController |
|
|
*/
|
|
|
public function edit()
|
|
|
{
|
|
|
$where=[];
|
|
|
if (cmf_get_current_admin_id()!=1){
|
|
|
$where['user_id']=cmf_get_current_admin_id();
|
|
|
};
|
|
|
$id = $this->request->param('id');
|
|
|
$data = Db::name('light')
|
|
|
->alias('l')
|
...
|
...
|
@@ -230,10 +246,10 @@ class AdminLightController extends AdminBaseController |
|
|
->field('l.*,t.name as tname,t.id as tid,t.address as taddress')
|
|
|
->find();
|
|
|
$data['location']=[$data['row'],$data['column']];
|
|
|
$address = Db::name('temple')->field('address')->distinct('true')->select();
|
|
|
$address = Db::name('temple')->where($where)->field('address')->distinct('true')->select();
|
|
|
$this->assign('address',$address);
|
|
|
if (!empty($data['taddress'])) {
|
|
|
$temple = Db::name('temple')->where('address', $data['taddress'])->select();
|
|
|
$temple = Db::name('temple')->where('address', $data['taddress'])->where($where)->select();
|
|
|
$this->assign('temple', $temple);
|
|
|
}
|
|
|
if(!empty($data['temple_id'])) {
|
...
|
...
|
|