| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- <?php
-
- namespace app\common\repositories\merchant\apply;
- use app\common\dao\merchant\apply\MerchantContributeDao;
- use app\common\repositories\BaseRepository;
- use think\facade\Db;
- /**
- * Class MerchantContributeRepository
- * @package app\common\repositories\merchant\apply
- * @author php迷途小书童
- * @created 2021/1/30 17:42
- */
- class MerchantContributeRepository extends BaseRepository
- {
- /**
- * MerchantRepository constructor.
- * @param MerchantContributeDao $dao
- */
- public function __construct(MerchantContributeDao $dao)
- {
- $this->dao = $dao;
- }
- /**
- * 获取单条信息
- * @return array|\think\Model|null
- * @author php迷途小书童
- * @created 2021/1/16 10:45
- */
- public function getOne($where)
- {
- return ($this->dao->getWhere($where));
- }
- /**
- * 查询列表
- *
- */
- public function queryList()
- {
- return Db::name('merchant_contribute')
- ->field("id,contribute_name,ratio_start,ratio_end,jing_dou,contribute_value")
- ->where('del_yn', 0)
- ->order('id', 'ASC')
- ->select();
- }
- public function deleteById($id)
- {
- return Db::name('merchant_contribute')
- ->where('id', $id)
- ->update(['del_yn'=>1]);
- }
- public function updateById($data, $id)
- {
- return Db::name('merchant_contribute')
- ->where('id', $id)
- ->update($data);
- }
- public function add($data)
- {
- return Db::name('merchant_contribute')
- ->insert($data);
- }
- }
|