Gutschriften
This commit is contained in:
parent
35ae3da244
commit
6ac9fcc4d2
20 changed files with 510 additions and 63 deletions
68
app/Models/UserPayCredit.php
Normal file
68
app/Models/UserPayCredit.php
Normal file
|
|
@ -0,0 +1,68 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Created by Reliese Model.
|
||||
*/
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class UserPayCredit
|
||||
*
|
||||
* @property int $id
|
||||
* @property int $user_id
|
||||
* @property float|null $credit
|
||||
* @property float|null $old_credit_total
|
||||
* @property float|null $new_credit_total
|
||||
* @property string|null $message
|
||||
* @property int $status
|
||||
* @property int|null $shopping_order_id
|
||||
* @property Carbon|null $created_at
|
||||
* @property Carbon|null $updated_at
|
||||
*
|
||||
* @property ShoppingOrder|null $shopping_order
|
||||
* @property User $user
|
||||
*
|
||||
* @package App\Models
|
||||
*/
|
||||
class UserPayCredit extends Model
|
||||
{
|
||||
|
||||
public $statusType = [
|
||||
1 => 'add from payment',
|
||||
2 => 'deduction from payment',
|
||||
];
|
||||
protected $table = 'user_pay_credits';
|
||||
|
||||
protected $casts = [
|
||||
'user_id' => 'int',
|
||||
'credit' => 'float',
|
||||
'old_credit_total' => 'float',
|
||||
'new_credit_total' => 'float',
|
||||
'status' => 'int',
|
||||
'shopping_order_id' => 'int'
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
'user_id',
|
||||
'credit',
|
||||
'old_credit_total',
|
||||
'new_credit_total',
|
||||
'message',
|
||||
'status',
|
||||
'shopping_order_id'
|
||||
];
|
||||
|
||||
public function shopping_order()
|
||||
{
|
||||
return $this->belongsTo(ShoppingOrder::class);
|
||||
}
|
||||
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue