Esempio n. 1
4
 /**
  * @param integer $object_model_id
  * @param string $type
  * @return string
  */
 public static function getSumPrice($object_model_id, $type)
 {
     $objects = static::find()->select('price')->where(['special_price_list_id' => ArrayHelper::map(SpecialPriceList::getModelsByKey($type), 'id', 'id'), 'object_model_id' => $object_model_id])->asArray()->all();
     return array_reduce($objects, function ($result, $item) {
         return $result += $item['price'];
     }, 0);
 }