Ejemplo n.º 1
0
 /**
  * 获取某产品的合作伙伴
  *
  * @param int $pid 产品ID
  * @param int $uId       发布者ID
  * @param int $aid       所属活动ID
  * @param int $num       查询条数
  *  - Default: 12
  * @return array
  */
 public function ProductPartnerlist($pid, $uId, $aid, $num = 12)
 {
     $conditions = ['uid' => $uId, 'product_id' => $pid, 'activity_id' => $aid];
     $models = ProductPartner::find()->select(['partners_title', 'partners_url', 'partners_logo'])->where($conditions)->orderBy(['partners_order' => SORT_DESC])->limit($num);
     $res = $models->asArray()->all();
     if ($res !== null) {
         return $res;
     } else {
         return false;
     }
 }