| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- <?php
- namespace app\common\repositories\shared;
- use app\common\dao\shared\SharedProsperityRecommendConfigDao;
- use app\common\repositories\BaseRepository;
- use app\entity\data\shared\SharedProsperityRecommendConfigEntity;
- class SharedProsperityRecommendConfigRepository extends BaseRepository
- {
- protected $dao;
- /**
- * SharedProsperityUserRepository constructor.
- * @param SharedProsperityRecommendConfigDao $dao
- */
- public function __construct(SharedProsperityRecommendConfigDao $dao)
- {
- $this->dao = $dao;
- }
- public function create($data)
- {
- return $this->dao->create($data);
- }
- /**
- * @param SharedProsperityRecommendConfigEntity $sharedProsperityRecommendConfigEntity
- * @return SharedProsperityRecommendConfigEntity
- */
- public function createByEntity(SharedProsperityRecommendConfigEntity $sharedProsperityRecommendConfigEntity): SharedProsperityRecommendConfigEntity
- {
- $result = $this->create($sharedProsperityRecommendConfigEntity->toUnderlineArray())->toArray();
- /** @var SharedProsperityRecommendConfigEntity $entity */
- $entity = SharedProsperityRecommendConfigEntity::newInstance($result);
- return $entity;
- }
- /**
- * @return array
- * @author 史晨
- * @date 2026/2/5 14:12
- */
- public function getList(): array
- {
- return $this->dao->getConfigList();
- }
- /**
- * @param $id
- * @return array
- * @author 史晨
- * @date 2026/2/5 14:12
- */
- public function getDetail($id)
- {
- return $this->dao->getDetailById($id);
- }
- /**
- * @param $params
- * @return bool
- * @author 史晨
- * @date 2026/2/5 14:12
- */
- public function update($params)
- {
- $id = $params['id'];
- unset($params['id']);
- if (!$this->dao->update($id, $params)){
- return false;
- }
- return true;
- }
- }
|