12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- <?php
- namespace app\dao\other;
- use app\dao\BaseDao;
- use app\model\other\Agreement;
- class AgreementDao extends BaseDao
- {
-
- public function setModel(): string
- {
- return Agreement::class;
- }
-
- public function saveAgreement(array $agreement, int $id = 0)
- {
- if (!$agreement) return false;
- $agreement['add_time'] = time();
- if($id){
- return $this->getModel()->update($agreement,['id' => $id]);
- }
- return $this->getModel()->save($agreement);
- }
- }
|