|
@@ -40,6 +40,12 @@ class bonusexControl extends mobileControl
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ private function isMineType(bonus\type $type)
|
|
|
+ {
|
|
|
+ return ($type->sender_id() == $_SESSION['member_id'] || $type->relayer_id() == $_SESSION['member_id']);
|
|
|
+ }
|
|
|
+
|
|
|
public function openOp()
|
|
|
{
|
|
|
if(!isset($_GET['type_sn']) || empty($_GET['type_sn'])) {
|
|
@@ -54,6 +60,7 @@ class bonusexControl extends mobileControl
|
|
|
$this->fileter_typeinfos($type_infos,$type_info,$binded_info);
|
|
|
$type = \bonus\type::crate_by_paramer($type_infos['type_info']);
|
|
|
|
|
|
+ $isMineType = $this->isMineType($type);
|
|
|
if($type->isStart() == false) {
|
|
|
return self::outsuccess(array('type_info' => $type_info),"bonus/unstart");
|
|
|
}
|
|
@@ -72,7 +79,7 @@ class bonusexControl extends mobileControl
|
|
|
}
|
|
|
}
|
|
|
$data = array('type_info' => $type_info, 'mine_bonus' => $mine_bonus,'binded_info' => $binded_info);
|
|
|
- if($bonus->isBinded()) {
|
|
|
+ if($bonus->isBinded() || $isMineType) {
|
|
|
return self::outsuccess($data,"bonus/content");
|
|
|
}
|
|
|
else
|
|
@@ -86,13 +93,25 @@ class bonusexControl extends mobileControl
|
|
|
}
|
|
|
else
|
|
|
{ //我没有抢过的情况
|
|
|
- if($type->isEnd()) {
|
|
|
- return self::outsuccess(array('type_info' => $type_info),"bonus/end");
|
|
|
+ if($isMineType == false)
|
|
|
+ {
|
|
|
+ if($type->isEnd()) {
|
|
|
+ return self::outsuccess(array('type_info' => $type_info),"bonus/end");
|
|
|
+ }
|
|
|
+ else if($type->binded_over()) {
|
|
|
+ return self::outsuccess(array('type_info' => $type_info,'msg' => "手慢了,红包派完了"),"bonus/over");
|
|
|
+ } else {
|
|
|
+ return self::outsuccess(array('type_info' => $type_info),"bonus/open");
|
|
|
+ }
|
|
|
}
|
|
|
- else if($type->binded_over()) {
|
|
|
- return self::outsuccess(array('type_info' => $type_info,'msg' => "手慢了,红包派完了"),"bonus/over");
|
|
|
- } else {
|
|
|
- return self::outsuccess(array('type_info' => $type_info),"bonus/open");
|
|
|
+ else
|
|
|
+ {
|
|
|
+ if($type->isEnd() || $type->binded_over()) {
|
|
|
+ return self::outsuccess(array('type_info' => $type_info,'binded_info' => $binded_info),'bonus/detail');
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ return self::outsuccess(array('type_info' => $type_info),"bonus/open");
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|