|
@@ -56,7 +56,7 @@ class Family extends Api
|
|
|
$idcardfind = \app\common\model\GuildJoinin::where(["user_id"=>$user_id,"status"=>0])->find();
|
|
|
if($idcardfind) $this->error("您存在加入公会的申请,正在审核中,请耐心等待!");
|
|
|
|
|
|
- $memberfind = \app\common\model\GuildMember::where(["user_id"=>$user_id,"status"=>1,"sign_time"=>["gt",time()]])->find();
|
|
|
+ $memberfind = \app\common\model\GuildMember::where(["user_id"=>$user_id,"status"=>1])->find();
|
|
|
if($memberfind) $guild_id = $memberfind->guild_id;
|
|
|
|
|
|
if(!$guild_id) {
|
|
@@ -109,7 +109,7 @@ class Family extends Api
|
|
|
$idcardfind = \app\common\model\GuildJoinin::where(["user_id"=>$user_id,"status"=>0])->find();
|
|
|
if($idcardfind) $this->error("您存在加入公会的申请,正在审核中,请耐心等待!");
|
|
|
|
|
|
- $memberfind = \app\common\model\GuildMember::where(["user_id"=>$user_id,"status"=>1,"sign_time"=>["gt",time()]])->find();
|
|
|
+ $memberfind = \app\common\model\GuildMember::where(["user_id"=>$user_id,"status"=>1])->find();
|
|
|
if($memberfind) $guild_id = $memberfind->guild_id;
|
|
|
|
|
|
$guildWhere['user_id'] = $user_id;
|
|
@@ -174,9 +174,7 @@ class Family extends Api
|
|
|
$guild_image = input("guild_image"); //logo
|
|
|
$guild_desc = input("guild_desc"); //公会简介
|
|
|
$guild_notice = input("guild_notice"); //公会公告
|
|
|
- $guild_info = input("guild_info"); //公会宣言
|
|
|
- $province_id = input("province_id"); //省id
|
|
|
- $city_id = input("city_id"); //市id
|
|
|
+
|
|
|
|
|
|
if(!$guild_name || !$guild_image){
|
|
|
throw new Exception("公会名和logo必填!");
|
|
@@ -211,9 +209,7 @@ class Family extends Api
|
|
|
$guild_image && $guildInfo->image = $guild_image;
|
|
|
$guild_desc && $guildInfo->desc = $guild_desc;
|
|
|
$guild_notice && $guildInfo->notice = $guild_notice;
|
|
|
- $guild_info && $guildInfo->info = $guild_info;
|
|
|
- $province_id && $guildInfo->province_id = $province_id;
|
|
|
- $city_id && $guildInfo->city_id = $city_id;
|
|
|
+
|
|
|
$res = $guildInfo->save();
|
|
|
|
|
|
if($res !== false) {
|
|
@@ -223,8 +219,6 @@ class Family extends Api
|
|
|
'guild_id' => $guildInfo->id,
|
|
|
'user_id' => $user_id,
|
|
|
'role' => 2, //角色:0=成员,1=副会长,2=会长
|
|
|
- 'sign_type' => 3,//签约类型:1=三个月,2=半年,3=一年
|
|
|
- 'sign_time' => 0,
|
|
|
'status' => 1, //状态:1=签约中,2=已解约
|
|
|
'createtime' => time(),
|
|
|
];
|
|
@@ -391,8 +385,6 @@ class Family extends Api
|
|
|
$data["guild_id"] = $guildInfo->id;
|
|
|
$data["user_id"] = $joininInfo->user_id;
|
|
|
$data["role"] = 0;
|
|
|
- $data["sign_type"] = $join_time; // 签约类型:1=三个月,2=半年,3=一年
|
|
|
- $data["sign_time"] = $endtime;
|
|
|
$data["status"] = 1;
|
|
|
$data["createtime"] = time();
|
|
|
$res3 = \app\common\model\GuildMember::insert($data);
|
|
@@ -486,7 +478,6 @@ class Family extends Api
|
|
|
$where = [];
|
|
|
$where["a.guild_id"] = $guild_id;
|
|
|
$where["a.status"] = 1;
|
|
|
- //$where["a.sign_time"] = ["gt",time()];
|
|
|
// 获取公会成员总数
|
|
|
$guildMemberCount = \app\common\model\GuildMember::alias("a")->where($where)->count("id");
|
|
|
// 获取公会成员列表
|