User Order all Margins / Checkout
This commit is contained in:
parent
a96d7d5c77
commit
224bf9e951
92 changed files with 3551 additions and 561 deletions
|
|
@ -31,15 +31,21 @@ use Illuminate\Database\Eloquent\Model;
|
|||
* @property array|null $trans_content
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|UserLevel whereContent($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|UserLevel whereTransContent($value)
|
||||
* @property bool $partner_provision
|
||||
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\UserLevelMargin[] $user_level_margins
|
||||
* @property-read int|null $user_level_margins_count
|
||||
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\UserLevelMargin[] $user_level_margins_re
|
||||
* @property-read int|null $user_level_margins_re_count
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|UserLevel wherePartnerProvision($value)
|
||||
*/
|
||||
class UserLevel extends Model
|
||||
{
|
||||
protected $table = 'user_levels';
|
||||
|
||||
protected $casts = ['trans_name' => 'array', 'trans_content' => 'array'];
|
||||
protected $casts = ['trans_name' => 'array', 'trans_content' => 'array', 'partner_provision'=>'bool'];
|
||||
|
||||
protected $fillable = [
|
||||
'name', 'content', 'pos', 'active',
|
||||
'name', 'content', 'pos', 'active', 'partner_provision',
|
||||
];
|
||||
|
||||
|
||||
|
|
@ -49,6 +55,17 @@ class UserLevel extends Model
|
|||
}
|
||||
*/
|
||||
|
||||
|
||||
public function user_level_margins()
|
||||
{
|
||||
return $this->hasMany('App\Models\UserLevelMargin', 'user_level_id', 'id');
|
||||
}
|
||||
|
||||
public function user_level_margins_re()
|
||||
{
|
||||
return $this->hasMany('App\Models\UserLevelMargin', 'user_level_id', 'id')->orderBy('price_from', 'DESC');
|
||||
}
|
||||
|
||||
public function setPosAttribute($value){
|
||||
$this->attributes['pos'] = is_numeric($value) ? $value : null;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue