Your Name 3 年之前
父節點
當前提交
95b31e9af9
共有 1 個文件被更改,包括 9 次插入6 次删除
  1. 9 6
      learn/active/lib/Active.php

+ 9 - 6
learn/active/lib/Active.php

@@ -52,12 +52,15 @@ class Active
 		}
 		if ($title && $member) {
 			foreach ($title as $k => $v) {
-				if($v['id'] == $member['title_id']) {
-					if ($v['num'] > 0 && $num > $v['num']) {
-						Dever::alert('您已超过限购数量');
-					}
-					if ($order && $order['total']  && $v['num'] > 0 && $order['total'] > $v['num']) {
-						Dever::alert('您已超过限购数量');
+				if ($member['title_id']) {
+					$title_id = explode(',',$member['title_id']);
+					if($title_id && in_array($v['id'],$title_id)) {
+						if ($v['num'] > 0 && $num > $v['num']) {
+							Dever::alert('您已超过限购数量');
+						}
+						if ($order && $order['total']  && $v['num'] > 0 && $order['total'] > $v['num']) {
+							Dever::alert('您已超过限购数量');
+						}
 					}
 				}
 			}