public static function getManagedProduct($userId) { $mapInfos = MapProductUser::model()->findAllByAttributes(array('test_user_id' => $userId)); $productIdArr = array(); foreach ($mapInfos as $info) { $productIdArr[] = $info['product_id']; } sort($productIdArr); return $productIdArr; }
public static function getProductManagerIds($productId) { $managerIds = array(); $managerInfos = MapProductUser::model()->findAllByAttributes(array('product_id' => $productId)); foreach ($managerInfos as $managerInfo) { $managerIds[] = $managerInfo['test_user_id']; } return $managerIds; }