20-02-2026
This commit is contained in:
parent
a8b395e20d
commit
a00c42e770
252 changed files with 28785 additions and 8907 deletions
|
|
@ -17,6 +17,7 @@ use Illuminate\Database\Eloquent\Model;
|
|||
* @property-read \App\User|null $auth_user
|
||||
* @property-read \App\Models\Country $country
|
||||
* @property-read \App\Models\UserShop $user_shop
|
||||
*
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ShoppingInstance newModelQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ShoppingInstance newQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ShoppingInstance query()
|
||||
|
|
@ -27,24 +28,38 @@ use Illuminate\Database\Eloquent\Model;
|
|||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ShoppingInstance whereSubdomain($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ShoppingInstance whereUpdatedAt($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ShoppingInstance whereUserShopId($value)
|
||||
*
|
||||
* @property int|null $payment
|
||||
*
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ShoppingInstance wherePayment($value)
|
||||
*
|
||||
* @property array|null $shopping_data
|
||||
* @property string|null $back
|
||||
*
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ShoppingInstance whereBack($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ShoppingInstance whereShoppingData($value)
|
||||
*
|
||||
* @property string|null $language
|
||||
*
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|ShoppingInstance whereLanguage($value)
|
||||
*
|
||||
* @property int|null $status
|
||||
* @property float|null $amount
|
||||
* @property int|null $shopping_user_id
|
||||
*
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|ShoppingInstance whereAmount($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|ShoppingInstance whereShoppingUserId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|ShoppingInstance whereStatus($value)
|
||||
*
|
||||
* @mixin \Eloquent
|
||||
*/
|
||||
class ShoppingInstance extends Model
|
||||
{
|
||||
protected $primaryKey = 'identifier';
|
||||
|
||||
public $incrementing = false;
|
||||
|
||||
protected $keyType = 'string';
|
||||
|
||||
public $paymentTypes = [
|
||||
1 => 'Customer Shop',
|
||||
|
|
@ -72,17 +87,30 @@ class ShoppingInstance extends Model
|
|||
protected $casts = ['shopping_data' => 'array', 'amount' => 'float'];
|
||||
|
||||
protected $fillable = [
|
||||
'identifier', 'user_shop_id', 'auth_user_id', 'status', 'payment', 'subdomain', 'language', 'country_id', 'amount', 'shopping_user_id', 'shopping_data', 'back'
|
||||
'identifier',
|
||||
'user_shop_id',
|
||||
'auth_user_id',
|
||||
'status',
|
||||
'payment',
|
||||
'subdomain',
|
||||
'language',
|
||||
'country_id',
|
||||
'amount',
|
||||
'shopping_user_id',
|
||||
'shopping_data',
|
||||
'back',
|
||||
];
|
||||
|
||||
public function getStatus(){
|
||||
public function getStatus()
|
||||
{
|
||||
return isset($this->statuses[$this->status]) ? $this->statuses[$this->status] : 'link_sent';
|
||||
}
|
||||
|
||||
public function getLocale(){
|
||||
public function getLocale()
|
||||
{
|
||||
return $this->language ? $this->language : \App::getLocale();
|
||||
}
|
||||
|
||||
|
||||
public function user_shop()
|
||||
{
|
||||
return $this->belongsTo('App\Models\UserShop', 'user_shop_id');
|
||||
|
|
@ -93,17 +121,14 @@ class ShoppingInstance extends Model
|
|||
return $this->belongsTo('App\Models\Country', 'country_id');
|
||||
}
|
||||
|
||||
//can null
|
||||
// can null
|
||||
public function auth_user()
|
||||
{
|
||||
return $this->belongsTo('App\User','auth_user_id');
|
||||
return $this->belongsTo('App\User', 'auth_user_id');
|
||||
}
|
||||
|
||||
public function getAmountFormatted(){
|
||||
public function getAmountFormatted()
|
||||
{
|
||||
return formatNumber($this->amount);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue