Gutschriften manuell hinzufügen, Yard 0& tax
This commit is contained in:
parent
e670b92f5d
commit
c02fffd883
24 changed files with 497 additions and 68 deletions
76
app/Models/UserCreditMargin.php
Normal file
76
app/Models/UserCreditMargin.php
Normal file
|
|
@ -0,0 +1,76 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Created by Reliese Model.
|
||||
*/
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class UserCreditMargin
|
||||
*
|
||||
* @property int $id
|
||||
* @property int $user_id
|
||||
* @property float|null $credit
|
||||
* @property string|null $message
|
||||
* @property int $status
|
||||
* @property Carbon|null $created_at
|
||||
* @property Carbon|null $updated_at
|
||||
* @property User $user
|
||||
* @package App\Models
|
||||
* @property bool|null $paid
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|UserCreditMargin newModelQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|UserCreditMargin newQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|UserCreditMargin query()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|UserCreditMargin whereCreatedAt($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|UserCreditMargin whereCredit($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|UserCreditMargin whereId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|UserCreditMargin whereMessage($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|UserCreditMargin wherePaid($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|UserCreditMargin whereStatus($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|UserCreditMargin whereUpdatedAt($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|UserCreditMargin whereUserId($value)
|
||||
* @mixin \Eloquent
|
||||
*/
|
||||
class UserCreditMargin extends Model
|
||||
{
|
||||
|
||||
public $statusType = [
|
||||
1 => 'manually added margin',
|
||||
];
|
||||
|
||||
protected $table = 'user_credit_margins';
|
||||
|
||||
protected $casts = [
|
||||
'user_id' => 'int',
|
||||
'credit' => 'float',
|
||||
'status' => 'int',
|
||||
'paid' => 'bool',
|
||||
'user_credit_id' => 'int',
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
'user_id',
|
||||
'credit',
|
||||
'message',
|
||||
'status',
|
||||
'paid',
|
||||
'user_credit_id',
|
||||
];
|
||||
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo('App\User','user_id');
|
||||
}
|
||||
|
||||
public function deleteTime(){
|
||||
$time = '+100 min';
|
||||
if(Carbon::parse($this->created_at)->modify($time)->gt(Carbon::now())){
|
||||
return Carbon::now()->diffInMinutes(Carbon::parse($this->created_at)->modify($time));
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue