You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
64 lines
1.8 KiB
64 lines
1.8 KiB
<?php
|
|
/**
|
|
* Created by ETEDU.
|
|
* User: Leo Chu
|
|
* Date: 2017/3/28 0028
|
|
* Time: 15:45
|
|
*/
|
|
|
|
namespace app\capital\model;
|
|
|
|
use think\Model;
|
|
|
|
|
|
/**
|
|
* 文化四板申请用户基本信息(企业、人才、项目)
|
|
* @package app\admin\model
|
|
*/
|
|
class Capitalbaseinfo extends Model
|
|
{
|
|
/**
|
|
* 增加申请
|
|
* @return int 0或申请id
|
|
*/
|
|
public static function baseinfo_add($status=1,$user_id,$member_list_id,$usertype,$apply_admin_id)
|
|
{
|
|
//status默认初审中(已提交):1
|
|
$sldata=array(
|
|
'user_id' => $user_id,
|
|
'status'=>$status,
|
|
'user_type'=>$usertype,
|
|
'apply_admin_id'=>$apply_admin_id,
|
|
'create_time'=>time(),
|
|
);
|
|
$member=self::create($sldata);
|
|
if($member){
|
|
return $member['apply_id'];
|
|
}else{
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
/**
|
|
* 会员信息列表
|
|
* @param array
|
|
* @param string $search_name 查询条件(公司名称)
|
|
* @param int $status 后台查询的操作用户状态
|
|
* @param int $admin_id 后台查询的操作用户ID
|
|
* @param string $order 结果排序
|
|
* @return mixed
|
|
*/
|
|
public static function getList($search_name=null,$status=-1,$admin_id,$order='apply_id')
|
|
{
|
|
$map=array();
|
|
if($search_name){
|
|
$map['admin_username']= array('like',"%".$search_name."%");
|
|
}
|
|
//根据状态值取出对应状态的数据
|
|
if($status != -1)$map['status'] = array('eq',$status);//array(array('eq',0),array('eq',$status), 'or');
|
|
//取得apply_admin_id为0或者当前用户的数据
|
|
$map['apply_admin_id']=array(array('eq',0),array('eq',$admin_id),'or');
|
|
return self::where($map)->order($order)->paginate(config('paginate.list_rows'),false,['query'=>get_query()]);
|
|
}
|
|
|
|
}
|