MobileOrderOperation.php 638 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. namespace app\common\model;
  3. use app\admin\model\Admin;
  4. use think\Model;
  5. use Yansongda\Supports\Str;
  6. /**
  7. * 配置模型
  8. */
  9. class MobileOrderOperation extends Model
  10. {
  11. protected $autoWriteTimestamp=true;
  12. protected $updateTime=null;
  13. protected $append=[
  14. 'create_time_format',
  15. 'create_time_format_short',
  16. ];
  17. public function getCreateTimeFormatAttr($a,$m){
  18. return date('Y-m-d H:i:s',$m['create_time']);
  19. }
  20. public function getCreateTimeFormatShortAttr($a,$m){
  21. return date('m/d',$m['create_time']);
  22. }
  23. public function admin(){
  24. return $this->belongsTo(Admin::class);
  25. }
  26. }