BaseModel.php 419 B

12345678910111213141516171819
  1. <?php
  2. namespace app\common\base\model;
  3. use think\Model;
  4. abstract class BaseModel extends Model {
  5. // 数据表名称
  6. protected $table = null;
  7. public function __construct($data = [])
  8. {
  9. $this->beforeConstruct($data);
  10. parent::__construct($data);
  11. $this->afterConstruct($data);
  12. }
  13. protected function beforeConstruct($data){}
  14. protected function afterConstruct($data){}
  15. }