weizong song 5 years ago
parent 6a37d444b4
commit 283e53d48b

@ -21,7 +21,9 @@ class Orders extends SoftDeletesModel
const TEXT_ONGOING = "进行中"; const TEXT_ONGOING = "进行中";
const TEXT_FINISHED = "已完成"; const TEXT_FINISHED = "已完成";
public function getStatusLabelAttribute($pure_text = false) protected $appends = ["status_name"];
public function getStatusLabelAttribute($pure_text = true)
{ {
switch ($this->status) { switch ($this->status) {
case self::STATUS_UNCONFIRMED: case self::STATUS_UNCONFIRMED:
@ -45,6 +47,10 @@ class Orders extends SoftDeletesModel
} }
} }
public function getStatusNameAttribute() {
return $this->getStatusLabelAttribute();
}
protected static function booted() protected static function booted()
{ {
static::addGlobalScope(new AdminProjectScope()); static::addGlobalScope(new AdminProjectScope());

Loading…
Cancel
Save