|
@@ -73,6 +73,8 @@ class opgroup
|
|
|
|
|
|
public function info($gid)
|
|
public function info($gid)
|
|
{
|
|
{
|
|
|
|
+ if($this->acting() == false) return false;
|
|
|
|
+
|
|
if(algorithm::binary_search($this->mGoods,$gid))
|
|
if(algorithm::binary_search($this->mGoods,$gid))
|
|
{
|
|
{
|
|
$result['special_id'] = $this->mSpecialID;
|
|
$result['special_id'] = $this->mSpecialID;
|
|
@@ -179,10 +181,16 @@ class optional_goods
|
|
$gid = intval($goods_id);
|
|
$gid = intval($goods_id);
|
|
if ($gid <= 0) return false;
|
|
if ($gid <= 0) return false;
|
|
|
|
|
|
- if (algorithm::binary_search($this->mAllGoods, $gid)) {
|
|
|
|
- foreach ($this->mOpgroups as $group) {
|
|
|
|
|
|
+ if (algorithm::binary_search($this->mAllGoods, $gid))
|
|
|
|
+ {
|
|
|
|
+ foreach ($this->mOpgroups as $group)
|
|
|
|
+ {
|
|
$info = $group->info($gid);
|
|
$info = $group->info($gid);
|
|
- if ($info != false) {
|
|
|
|
|
|
+ if($info == false) continue;
|
|
|
|
+
|
|
|
|
+ if($group->acting() == false) {
|
|
|
|
+ return false;
|
|
|
|
+ } else {
|
|
return $info;
|
|
return $info;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -201,9 +209,9 @@ class optional_goods
|
|
$match_goods = $this->sel_goods($match_goods, $gidnums);
|
|
$match_goods = $this->sel_goods($match_goods, $gidnums);
|
|
|
|
|
|
$result = [];
|
|
$result = [];
|
|
- foreach ($this->mOpgroups as $opgroup) {
|
|
|
|
|
|
+ foreach ($this->mOpgroups as $opgroup)
|
|
|
|
+ {
|
|
if (empty($match_goods)) break;
|
|
if (empty($match_goods)) break;
|
|
-
|
|
|
|
$part = $opgroup->match($match_goods);
|
|
$part = $opgroup->match($match_goods);
|
|
if ($part != false) {
|
|
if ($part != false) {
|
|
$result[] = $part;
|
|
$result[] = $part;
|