AgreementDao.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2016~2023 https://www.crmeb.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  8. // +----------------------------------------------------------------------
  9. // | Author: CRMEB Team <admin@crmeb.com>
  10. // +----------------------------------------------------------------------
  11. namespace app\dao\other;
  12. use app\dao\BaseDao;
  13. use app\model\other\Agreement;
  14. /**
  15. * Class AgreementDao
  16. * @package app\dao\other
  17. */
  18. class AgreementDao extends BaseDao
  19. {
  20. /**
  21. * @return string
  22. */
  23. public function setModel(): string
  24. {
  25. return Agreement::class;
  26. }
  27. /**修改协议内容
  28. * @param array $where
  29. * @param $agreement
  30. * @return bool|\crmeb\basic\BaseModel
  31. */
  32. public function saveAgreement(array $agreement, $id = 0)
  33. {
  34. if (!$agreement) return false;
  35. $agreement['add_time'] = time();
  36. if($id){
  37. return $this->getModel()->update($agreement,['id' => $id]);
  38. }
  39. return $this->getModel()->save($agreement);
  40. }
  41. }