Card.php 844 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. namespace app\model;
  3. use DateTimeInterface;
  4. use support\Model;
  5. class Card extends Model
  6. {
  7. public $table = 'card';
  8. public $primaryKey = 'card_id';
  9. protected $dateFormat = 'U';
  10. const CREATED_AT = 'card_addtimes';
  11. const UPDATED_AT = null;
  12. //卡状态 INTI=初始化|PRODUCTED=制作完成|ENABLED=已启用|WAITING=已分配|PENDING=待激活|ACTIVED=已激活|DISABLED=已禁用|EXPIRED=已过期|PAUSED=暂停使用
  13. public const CARD_STATUS = ['INIT' => '初始化', 'PRODUCTED' => '制作完成', 'ENABLED' => '已启用', 'WAITING' => '已分配', 'PENDING' => '待激活', 'ACTIVED' => '已激活', 'DISABLED' => '已禁用', 'EXPIRED' => '已过期', 'PAUSED' => '暂停使用'];
  14. public function serializeDate(DateTimeInterface $date)
  15. {
  16. return $date->format('Y-m-d H:i:s');
  17. }
  18. }