Updates to 03-2025
This commit is contained in:
parent
bfa3bb1df4
commit
9ae662f63e
243 changed files with 12580 additions and 12018 deletions
|
|
@ -12,18 +12,26 @@ use Illuminate\Database\Eloquent\Model;
|
|||
|
||||
/**
|
||||
* Class UserAboOrder
|
||||
*
|
||||
*
|
||||
* @property int $id
|
||||
* @property int $user_abo_id
|
||||
* @property int $shopping_order_id
|
||||
* @property int $status
|
||||
* @property Carbon|null $created_at
|
||||
* @property Carbon|null $updated_at
|
||||
*
|
||||
* @property ShoppingOrder $shopping_order
|
||||
* @property UserAbo $user_abo
|
||||
*
|
||||
* @package App\Models
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|UserAboOrder newModelQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|UserAboOrder newQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|UserAboOrder query()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|UserAboOrder whereCreatedAt($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|UserAboOrder whereId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|UserAboOrder whereShoppingOrderId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|UserAboOrder whereStatus($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|UserAboOrder whereUpdatedAt($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|UserAboOrder whereUserAboId($value)
|
||||
* @mixin \Eloquent
|
||||
*/
|
||||
class UserAboOrder extends Model
|
||||
{
|
||||
|
|
@ -42,6 +50,30 @@ class UserAboOrder extends Model
|
|||
'status'
|
||||
];
|
||||
|
||||
public static $statusTypes = [
|
||||
0 => 'abo_new',
|
||||
1 => 'abo_new',
|
||||
2 => 'abo_okay',
|
||||
3 => 'abo_hold',
|
||||
4 => 'abo_cancel',
|
||||
5 => 'abo_finish',
|
||||
6 => 'abo_inactive',
|
||||
7 => 'abo_grace'
|
||||
];
|
||||
|
||||
public static $statusColors = [
|
||||
0 => 'success',
|
||||
1 => 'success',
|
||||
2 => 'secondary',
|
||||
3 => 'warning',
|
||||
4 => 'danger',
|
||||
5 => 'info',
|
||||
6 => 'warning',
|
||||
7 => 'danger'
|
||||
];
|
||||
|
||||
|
||||
|
||||
public function shopping_order()
|
||||
{
|
||||
return $this->belongsTo(ShoppingOrder::class);
|
||||
|
|
@ -51,4 +83,17 @@ class UserAboOrder extends Model
|
|||
{
|
||||
return $this->belongsTo(UserAbo::class);
|
||||
}
|
||||
|
||||
public function getStatusFormated(){
|
||||
return '<span class="badge badge-pill badge-'.$this->getStatusColor().'">'.$this->getStatusType().'</span>';
|
||||
}
|
||||
|
||||
public function getStatusType(){
|
||||
return isset(self::$statusTypes[$this->status]) ? __('abo.'.self::$statusTypes[$this->status]) : "";
|
||||
}
|
||||
|
||||
public function getStatusColor(){
|
||||
return isset(self::$statusColors[$this->status]) ? self::$statusColors[$this->status] : "default";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue