| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- <?php
- /**
- * @package merchant
- *
- * @author xaboy
- * @day 2020-04-16
- *
- *
- */
- namespace app\common\dao\system\merchant;
- use app\common\dao\BaseDao;
- use app\common\model\system\merchant\MerchantHaikeRefund;
- use think\db\BaseQuery;
- use think\db\exception\DataNotFoundException;
- use think\db\exception\DbException;
- use think\db\exception\ModelNotFoundException;
- use think\Model;
- class MerchantHaikeRefundDao extends BaseDao
- {
- /**
- * @return string
- * @author xaboy
- * @day 2020-04-16
- */
- protected function getModel(): string
- {
- return MerchantHaikeRefund::class;
- }
- /**
- * @param array $where
- * @return BaseQuery
- * @author xaboy
- * @day 2020-04-16
- */
- public function search(array $where)
- {
- $query = MerchantHaikeRefund::getDB()
- ->when(isset($where['date']) && $where['date'] !== '', function ($query) use ($where) {
- getModelTime($query, $where['date']);
- })->order('id', 'desc');
- return $query;
- }
- /**
- * @param int $id
- * @return array|Model|null
- * @throws DataNotFoundException
- * @throws DbException
- * @throws ModelNotFoundException
- * @author xaboy
- * @day 2020-04-17
- */
- public function get( $id)
- {
- return MerchantHaikeRefund::getInstance()->find($id);
- }
- }
|