first commit
This commit is contained in:
77
application/mobile/controller/Member.php
Normal file
77
application/mobile/controller/Member.php
Normal file
@@ -0,0 +1,77 @@
|
||||
<?php
|
||||
// +------------------------------------------------+
|
||||
// |http://www.cjango.com |
|
||||
// +------------------------------------------------+
|
||||
// | 修复BUG不是一朝一夕的事情,等我喝醉了再说吧! |
|
||||
// +------------------------------------------------+
|
||||
// | Author: 小陈叔叔 <Jason.Chen> |
|
||||
// +------------------------------------------------+
|
||||
namespace app\mobile\controller;
|
||||
|
||||
use app\common\model\MemberList as MemberListModel;
|
||||
use app\common\service\MemberList as MemberListService;
|
||||
|
||||
class Member extends _Init
|
||||
{
|
||||
|
||||
public function _initialize()
|
||||
{
|
||||
parent::_initialize();
|
||||
$this->nav = 5;
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
$this->list = MemberListModel::where('uid', UID)->where('status', 'egt', 0)->select();
|
||||
return $this->fetch('');
|
||||
}
|
||||
|
||||
public function add()
|
||||
{
|
||||
if (IS_POST) {
|
||||
$data = $this->request->post();
|
||||
$res = MemberListService::create($data, UID);
|
||||
if ($res === true) {
|
||||
$this->success('添加成功', url('member/index'));
|
||||
} else {
|
||||
$this->error($res);
|
||||
}
|
||||
} else {
|
||||
$this->showfoot = '1';
|
||||
return $this->fetch('');
|
||||
}
|
||||
|
||||
}
|
||||
public function edit($id)
|
||||
{
|
||||
if (IS_POST) {
|
||||
$data = $this->request->post();
|
||||
$res = MemberListService::edit($data);
|
||||
if ($res === true) {
|
||||
$this->success('编辑成功', url('member/index'));
|
||||
} else {
|
||||
$this->error($res);
|
||||
}
|
||||
} else {
|
||||
$this->info = MemberListModel::get($id);
|
||||
return $this->fetch('add');
|
||||
}
|
||||
}
|
||||
|
||||
public function del($id)
|
||||
{
|
||||
$res = MemberListService::del($id);
|
||||
$this->back($res);
|
||||
// if ($res === true) {
|
||||
// $this->success('删除成功', url('member/index'));
|
||||
// } else {
|
||||
// $this->error($res);
|
||||
// }
|
||||
}
|
||||
|
||||
public function info($id)
|
||||
{
|
||||
$this->info = MemberListModel::get($id);
|
||||
return $this->fetch();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user