123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- <?php
- declare(strict_types=1);
- namespace catcher\base;
- use catcher\CatchQuery;
- use catcher\traits\db\BaseOptionsTrait;
- use catcher\traits\db\TransTrait;
- use think\model\concern\SoftDelete;
- use catcher\traits\db\ScopeTrait;
- abstract class CatchModel extends \think\Model
- {
- use SoftDelete, TransTrait, BaseOptionsTrait, ScopeTrait;
- protected $createTime = 'created_at';
- protected $updateTime = 'updated_at';
- protected $deleteTime = 'deleted_at';
- protected $defaultSoftDelete = 0;
- protected $autoWriteTimestamp = true;
- public const LIMIT = 10;
-
- public const ENABLE = 1;
-
- public const DISABLE = 2;
-
- public function hasField(string $field)
- {
- return property_exists($this, 'field') ? in_array($field, $this->field) : false;
- }
- }
|