diff --git a/Application/Payment/Controller/UserController.class.php b/Application/Payment/Controller/UserController.class.php new file mode 100644 index 000000000..b945f4b77 --- /dev/null +++ b/Application/Payment/Controller/UserController.class.php @@ -0,0 +1,80 @@ + + */ +class UserController extends BaseController +{ + + public function _initialize() + { + $this->admininfo = session('payment_user');; + // $this->DBModel = M("CompanyStatementPool","tab_"); + parent::_initialize(); + } + public function index() + { + $params = I('get.'); + $page = $params['p'] ? intval($params['p']) : 1; + $row = $params['row'] ? intval($params['row']) : 10; + + $data = M("PaymentMember","tab_")->page($page,$row)->order("id desc")->select(); + $count = M("PaymentMember","tab_")->count("id"); + $page = set_pagination($count, $row); + if ($page) { + $this->assign('_page', $page); + } + $this->meta_title = '打款结算单'; + $this->assign("data",$data); + + $this->display(); + } + public function add() + { + + if (IS_POST) { + $p = $_REQUEST; + $mobile = $p['mobile']; + /*检测用户名是否为空*/ + if (empty($p['mobile'])) { + $this->error('手机号码不能为空!'); + } + if (!preg_match('/^1[1-9]\d{9}$/', $p['mobile'])) { + return $this->error("手机号码格式错误"); + } + if (empty($p['real_name'])) { + $this->error('姓名允许为空'); + } + //判断手机唯一 + $check_mobile = M("Kv")->field("value")->where("`key`='payment_check_mobile' AND `value`= '{$mobile}'")->find(); + if(empty($check_mobile)){ + //获取普通登陆 + $plogin = M("payment_member","tab_")->where("`mobile`= '{$mobile}'")->find(); + if(!empty($plogin)){ + $this->error('手机号码已存在'); + } + }else{ + $this->error('手机号码已存在'); + } + M("payment_member","tab_")->add($p); + $this->success('用户添加成功!', U('index')); + } else { + $this->meta_title = '新增制表人'; + $this->display(); + } + } + public function delete($id) + { + $res = M('payment_member',"tab_")->where("id = '{$id}'")->delete(); + if ($res) { + $this->success('删除成功'); + } else { + $this->error('删除失败'); + } + } + + + + +} diff --git a/Application/Payment/View/ExcelPayment/lists.html b/Application/Payment/View/ExcelPayment/lists.html index 19f84250e..56580344d 100644 --- a/Application/Payment/View/ExcelPayment/lists.html +++ b/Application/Payment/View/ExcelPayment/lists.html @@ -221,7 +221,7 @@
说明:可设置制单账号
+姓名 | +手机号码 | + + +操作 | +
---|---|---|
{$vo.real_name} | +{$vo.mobile} | ++ 删除 + | +aOh! 暂时还没有内容! | +