| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- <?php
- namespace app\common\dao\shared;
- use app\common\dao\BaseDao;
- use app\common\model\shared\SharedProsperityRecommendConfig;
- use app\entity\data\shared\SharedProsperityRecommendConfigEntity;
- class SharedProsperityRecommendConfigDao extends BaseDao
- {
- protected function getModel(): string
- {
- return SharedProsperityRecommendConfig::class;
- }
- /**
- * @return array
- * @author 史晨
- * @date 2026/2/5 14:43
- * 获取推荐配置
- */
- public function getConfigList(): array
- {
- $entityList = [];
- try {
- /** @var SharedProsperityRecommendConfig $model */
- $model = $this->getModel();
- $dataRes = $model::getDB()
- ->select()
- ->toArray();
- if (!empty($dataRes)) {
- $entityList = array_map(function ($data) {
- return SharedProsperityRecommendConfigEntity::newInstance($data);
- }, $dataRes);
- }
- } catch (\Exception $e) {
- }
- return $entityList;
- }
- /**
- * @param $id
- * @return mixed
- * @author 史晨
- * @date 2026/2/5 14:43
- * 获取推荐配置详情
- */
- public function getDetailById($id)
- {
- /** @var SharedProsperityRecommendConfig $model */
- $model = $this->getModel();
- return $model::getDB()
- ->where(['id'=>$id])
- ->find();
- }
- }
|