added 新增应用编辑删除和状态修改

This commit is contained in:
zhaoxiang 2016-12-12 20:26:04 +08:00
parent 13943f5f3e
commit d4d31e375c

View File

@ -193,13 +193,13 @@ class AppManager extends Base {
public function open(){ public function open(){
if( $this->request->isPut() ){ if( $this->request->isPut() ){
$id = $this->request->put($this->primaryKey); $id = $this->request->put($this->primaryKey);
$appMemberObj = \app\admin\model\AppMember::get([$this->primaryKey => $id]); $appObj = App::get([$this->primaryKey => $id]);
if( is_null($appMemberObj) ){ if( is_null($appObj) ){
$this->error('管理员不存在',''); $this->error('当前应用不存在','');
}else{ }else{
$appMemberObj->status = 1; $appObj->status = 1;
$appMemberObj->save(); $appObj->save();
$this->success('操作成功', url('AppMember/index')); $this->success('操作成功', url('AppManager/index'));
} }
} }
} }
@ -207,13 +207,13 @@ class AppManager extends Base {
public function close(){ public function close(){
if( $this->request->isPut() ){ if( $this->request->isPut() ){
$id = $this->request->put($this->primaryKey); $id = $this->request->put($this->primaryKey);
$appMemberObj = \app\admin\model\AppMember::get([$this->primaryKey => $id]); $appObj = App::get([$this->primaryKey => $id]);
if( is_null($appMemberObj) ){ if( is_null($appObj) ){
$this->error('管理员不存在',''); $this->error('当前应用不存在','');
}else{ }else{
$appMemberObj->status = 0; $appObj->status = 0;
$appMemberObj->save(); $appObj->save();
$this->success('操作成功', url('AppMember/index')); $this->success('操作成功', url('AppManager/index'));
} }
} }
} }
@ -221,9 +221,9 @@ class AppManager extends Base {
public function del(){ public function del(){
if( $this->request->isDelete() ){ if( $this->request->isDelete() ){
$key = $this->request->delete($this->primaryKey); $key = $this->request->delete($this->primaryKey);
$delNum = \app\admin\model\AppMember::destroy($key); $delNum = App::destroy($key);
if( $delNum ){ if( $delNum ){
$this->success('操作成功!', url('AppMember/index')); $this->success('操作成功!', url('AppManager/index'));
} }
} }
$this->error('操作失败!'); $this->error('操作失败!');