API work
This commit is contained in:
parent
32595ab5a1
commit
13fb2cfe98
70 changed files with 3614 additions and 401 deletions
|
|
@ -107,28 +107,41 @@ class ShoppingOrder extends Model
|
|||
'paid',
|
||||
'txaction',
|
||||
'wp_invoice_path',
|
||||
'wp_notice',
|
||||
'mode',
|
||||
'shipped',
|
||||
'tracking'
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'wp_notice' => 'array',
|
||||
];
|
||||
|
||||
public static $shippedTypes = [
|
||||
0 => 'offen',
|
||||
1 => 'versendet',
|
||||
2 => 'abgeschlossen',
|
||||
4 => 'In Bearbeitung',
|
||||
1 => 'in Bearbeitung',
|
||||
2 => 'versendet',
|
||||
3 => 'abgeschlossen',
|
||||
10 => 'storniert'
|
||||
];
|
||||
|
||||
50 => 'storiniert'
|
||||
public static $apiShippedTypes = [
|
||||
0 => 'open', //(Fullfilment durch Händler)',
|
||||
1 => 'process', //(Fullfilment durch MIVITA: nicht Versand)
|
||||
2 => 'sent', //(Fullfilment durch MIVITA: Versand erfolgt)'
|
||||
3 => 'close', //(Fullfilment durch MIVITA: Versand erfolgt)',
|
||||
10 => 'cancel'
|
||||
];
|
||||
|
||||
public static $shippedColors = [
|
||||
0 => 'warning',
|
||||
1 => 'success',
|
||||
1 => 'info',
|
||||
2 => 'success',
|
||||
4 => 'info',
|
||||
50 => 'danger',
|
||||
3 => 'secondary',
|
||||
10 => 'danger',
|
||||
];
|
||||
|
||||
|
||||
public function shopping_user()
|
||||
{
|
||||
return $this->belongsTo('App\Models\ShoppingUser','shopping_user_id');
|
||||
|
|
@ -205,6 +218,10 @@ class ShoppingOrder extends Model
|
|||
return isset(self::$shippedTypes[$this->shipped]) ? self::$shippedTypes[$this->shipped] : "";
|
||||
}
|
||||
|
||||
public function getAPIShippedType(){
|
||||
return isset(self::$apiShippedTypes[$this->shipped]) ? self::$apiShippedTypes[$this->shipped] : "free";
|
||||
}
|
||||
|
||||
public function getShippedColor(){
|
||||
return isset(self::$shippedColors[$this->shipped]) ? self::$shippedColors[$this->shipped] : "default";
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue