|
@@ -381,7 +381,19 @@ class Info
|
|
|
if ($uid && $uid > 0) {
|
|
|
$role = $this->getRole($uid);
|
|
|
if ($role) {
|
|
|
- $data['discount'] = $role;
|
|
|
+ $role_state = false;
|
|
|
+ $discount_goods = Dever::db('act/discount_goods')->getData(array('discount_id' => $role['id']));
|
|
|
+ if ($discount_goods) {
|
|
|
+ $discount_goods = array_keys($discount_goods);
|
|
|
+ if (in_array($data['id'], $discount_goods)) {
|
|
|
+ $role_state = true;
|
|
|
+ }
|
|
|
+ } elseif ($role['category'] && in_array($data['top_category_id'], $role['category'])) {
|
|
|
+ $role_state = true;
|
|
|
+ }
|
|
|
+ if ($role_state) {
|
|
|
+ $data['discount'] = $role;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|