public function getProductsByUniverseAndByPlatform($universe = 'resto', $platform = 'zeChallenge') { return Model::FacturationProduct()->where(['univers', '=', $universe])->where(['platform', '=', $platform])->order('category_id')->cursor(); }
public function getProductsRealisation($reseller_id) { $count = Model::Myzelift()->where(['reseller_id', '=', (int) $reseller_id])->where(['status', '=', 'ACTIVE'])->cursor()->count(); $query = Model::FacturationProduct(); $univers = lib('zechallenge')->getContext($reseller_id); $query = $query->where(['univers', '=', (string) $univers])->where(['name', 'LIKE', 'RĂ©alisation %'])->where(['platform', '=', 'myZelift'])->order('name')->cursor(); $collection = []; foreach ($query as $row) { $collection[] = $row; } $query->reset(); return $collection; }