78 lines
3.9 KiB
PHP
78 lines
3.9 KiB
PHP
<?php
|
||
|
||
namespace App\Models\Real;
|
||
|
||
use App\Core\Model;
|
||
use App\Models\Card\Card;
|
||
|
||
/**
|
||
* App\Models\Real\AddedOrder
|
||
*
|
||
* @property int $id 订单ID
|
||
* @property string $sn 订单编号
|
||
* @property int $type 订单类型(1:套餐续费 2:续费包 3:加油包 4:可选包 5:附加包)
|
||
* @property int $company_id 企业ID
|
||
* @property string $transaction_no 交易流水号
|
||
* @property string $pay_channel 支付频道
|
||
* @property int $unit_price 单价
|
||
* @property int $counts 数量
|
||
* @property int $total_price 总价
|
||
* @property string|null $order_at 下单时间
|
||
* @property string|null $remark 订单备注
|
||
* @property \Illuminate\Support\Carbon|null $created_at
|
||
* @property \Illuminate\Support\Carbon|null $updated_at
|
||
* @property string|null $deleted_at
|
||
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\Card\Card[] $additionalPackageCards
|
||
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\Card\Card[] $flowPackageCards
|
||
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\Card\Card[] $optionalPackageCards
|
||
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\Card\Card[] $renewalCards
|
||
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\Card\Card[] $renewalPackageCards
|
||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Real\AddedOrder newModelQuery()
|
||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Real\AddedOrder newQuery()
|
||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Real\AddedOrder query()
|
||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Real\AddedOrder whereCompanyId($value)
|
||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Real\AddedOrder whereCounts($value)
|
||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Real\AddedOrder whereCreatedAt($value)
|
||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Real\AddedOrder whereDeletedAt($value)
|
||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Real\AddedOrder whereId($value)
|
||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Real\AddedOrder whereOrderAt($value)
|
||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Real\AddedOrder wherePayChannel($value)
|
||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Real\AddedOrder whereRemark($value)
|
||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Real\AddedOrder whereSn($value)
|
||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Real\AddedOrder whereTotalPrice($value)
|
||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Real\AddedOrder whereTransactionNo($value)
|
||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Real\AddedOrder whereType($value)
|
||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Real\AddedOrder whereUnitPrice($value)
|
||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Real\AddedOrder whereUpdatedAt($value)
|
||
* @mixin \Eloquent
|
||
*/
|
||
class AddedOrder extends Model
|
||
{
|
||
protected $table = 'real_added_orders';
|
||
|
||
public function renewalCards()
|
||
{
|
||
return $this->belongsToMany(Card::class, 'real_added_order_renewal_cards', 'sim', 'sim');
|
||
}
|
||
|
||
public function renewalPackageCards()
|
||
{
|
||
return $this->belongsToMany(Card::class, 'real_added_order_renewal_package_cards', 'sim', 'sim');
|
||
}
|
||
|
||
public function flowPackageCards()
|
||
{
|
||
return $this->belongsToMany(Card::class, 'real_added_order_flows_package_cards', 'sim', 'sim');
|
||
}
|
||
|
||
public function optionalPackageCards()
|
||
{
|
||
return $this->belongsToMany(Card::class, 'real_added_order_optional_package_cards', 'sim', 'sim');
|
||
}
|
||
|
||
public function additionalPackageCards()
|
||
{
|
||
return $this->belongsToMany(Card::class, 'real_added_order_additional_package_cards', 'sim', 'sim');
|
||
}
|
||
}
|