...
|
...
|
@@ -17,26 +17,30 @@ class WillUserApplyModel extends CommonModel { |
|
|
//array(验证字段,验证规则,错误提示,验证条件,附加规则,验证时间)
|
|
|
array('user_id', 'number', '用户ID不能为空', 1, 'regex', CommonModel::MODEL_BOTH),
|
|
|
array('name', 'require', '姓名不能为空', 1, 'regex', CommonModel::MODEL_BOTH),
|
|
|
// array('province', 'require', '所在省不能为空', 1, 'regex', CommonModel::MODEL_BOTH),
|
|
|
array('city', 'require', '城市不能为空', 1, 'regex', CommonModel::MODEL_BOTH),
|
|
|
array('sex', array(0,1,2), '性别格式错误', 1, 'in', CommonModel::MODEL_BOTH),
|
|
|
array('age', 'number', '年龄格式错误', 1, 'regex', CommonModel::MODEL_BOTH),
|
|
|
array('sex', array(0,1,2), '性别格式错误', 1, 'regex', CommonModel::MODEL_BOTH),
|
|
|
array('school', 'require', '高校不能为空', 1, 'regex', CommonModel::MODEL_BOTH),
|
|
|
array('major', 'require', '专业不能为空', 1, 'regex', CommonModel::MODEL_BOTH),
|
|
|
array('mobile', 'require', '手机号码不能为空', 1, 'regex', CommonModel::MODEL_BOTH),
|
|
|
array('mobile', 'mobile', '手机号码格式错误', 1, 'regex', CommonModel::MODEL_BOTH),
|
|
|
array('email', 'require', '邮箱不能为空', 1, 'regex', CommonModel::MODEL_BOTH),
|
|
|
array('email', 'email', '邮箱格式错误', 1, 'regex', CommonModel::MODEL_BOTH),
|
|
|
array('province', 'require', '所在省不能为空', 1, 'regex', CommonModel::MODEL_BOTH),
|
|
|
array('city', 'require', '城市不能为空', 1, 'regex', CommonModel::MODEL_BOTH),
|
|
|
array('school', 'require', '所在公司或高校不能为空', 1, 'regex', CommonModel::MODEL_BOTH),
|
|
|
array('major', 'require', '专业不能为空', 1, 'regex', CommonModel::MODEL_BOTH),
|
|
|
array('classes', 'require', '年级不能为空', 1, 'regex', CommonModel::MODEL_BOTH),
|
|
|
array('experience', 'require', '相关经验不能为空', 1, 'regex', CommonModel::MODEL_BOTH),
|
|
|
array('skill', 'require', '个人技能不能为空', 1, 'regex', CommonModel::MODEL_BOTH),
|
|
|
);
|
|
|
|
|
|
// 获取入会申请列表
|
|
|
public function getList($keyword = null) {
|
|
|
public function getList($keyword = null, $start_time = null, $end_time = null) {
|
|
|
$where['is_del'] = 0;
|
|
|
if($keyword) {
|
|
|
$where['name'] = array('like', '%'.$keyword.'%');
|
|
|
}
|
|
|
if($start_time && $end_time) {
|
|
|
$where['ctime'] = array('between', array($start_time,$end_time));
|
|
|
}
|
|
|
return $this->where($where)->select();
|
|
|
}
|
|
|
|
...
|
...
|
@@ -46,4 +50,29 @@ class WillUserApplyModel extends CommonModel { |
|
|
$where['id'] = $id;
|
|
|
return $this->where($where)->find();
|
|
|
}
|
|
|
|
|
|
// 获取用户是否提交入会申请
|
|
|
public function check($user_id) {
|
|
|
$where['is_del'] = 0;
|
|
|
$where['user_id'] = $user_id;
|
|
|
return $this->where($where)->find();
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 获取数据总数
|
|
|
* @author Liuzhen
|
|
|
*/
|
|
|
public function getCount($keyword = null, $start_time = null, $end_time = null) {
|
|
|
$where = array();
|
|
|
if($keyword) {
|
|
|
$where['name'] = array('like', '%'.$keyword.'%');
|
|
|
}
|
|
|
if($start_time && $end_time) {
|
|
|
$where['ctime'] = array('between', array($start_time,$end_time));
|
|
|
}
|
|
|
$where['is_del'] = 0;
|
|
|
$count = $this->where($where)
|
|
|
->count();
|
|
|
return $count;
|
|
|
}
|
|
|
} |
|
|
\ No newline at end of file |
...
|
...
|
|