|
@@ -0,0 +1,101 @@
|
|
|
|
|
+<?php
|
|
|
|
|
+
|
|
|
|
|
+namespace App\Models\Main;
|
|
|
|
|
+
|
|
|
|
|
+use DateTimeInterface;
|
|
|
|
|
+use Illuminate\Database\Eloquent\Model;
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+/**
|
|
|
|
|
+ * App\Models\Main\MainShopOrder
|
|
|
|
|
+ *
|
|
|
|
|
+ * @property int $id
|
|
|
|
|
+ * @property int $shop_id 店铺ID
|
|
|
|
|
+ * @property int $m_id 会员ID
|
|
|
|
|
+ * @property string $rs_sn 店铺订单支付编号
|
|
|
|
|
+ * @property string $pay_sn 支付编号
|
|
|
|
|
+ * @property int $pay_type 支付类型,1:微信,2:支付宝
|
|
|
|
|
+ * @property string $pay_money 支付金额
|
|
|
|
|
+ * @property int $status 1:待支付,2:已支付,3:已退款,已完成
|
|
|
|
|
+ * @property \Illuminate\Support\Carbon|null $created_at
|
|
|
|
|
+ * @property \Illuminate\Support\Carbon|null $updated_at
|
|
|
|
|
+ * @property float|null $discount 折扣金额
|
|
|
|
|
+ * @property int|null $is_clearing 是否清分 0:待清分,1:已清分
|
|
|
|
|
+ * @property string $service_money 平台手续费
|
|
|
|
|
+ * @property string $discount_money 让利金额
|
|
|
|
|
+ * @property string $earnings_money 收益金额
|
|
|
|
|
+ * @property string|null $return_sn 退款订单编号
|
|
|
|
|
+ * @property int|null $is_report 是否播报
|
|
|
|
|
+ * @property int|null $pay_code_source 支付收款码来源 1普通收款码 2烟草收款码
|
|
|
|
|
+ * @property int|null $is_bank 是否银联支付 0否1是
|
|
|
|
|
+ * @method static \Illuminate\Database\Eloquent\Builder|MainShopOrder newModelQuery()
|
|
|
|
|
+ * @method static \Illuminate\Database\Eloquent\Builder|MainShopOrder newQuery()
|
|
|
|
|
+ * @method static \Illuminate\Database\Eloquent\Builder|MainShopOrder query()
|
|
|
|
|
+ * @method static \Illuminate\Database\Eloquent\Builder|MainShopOrder whereCreatedAt($value)
|
|
|
|
|
+ * @method static \Illuminate\Database\Eloquent\Builder|MainShopOrder whereDiscount($value)
|
|
|
|
|
+ * @method static \Illuminate\Database\Eloquent\Builder|MainShopOrder whereDiscountMoney($value)
|
|
|
|
|
+ * @method static \Illuminate\Database\Eloquent\Builder|MainShopOrder whereEarningsMoney($value)
|
|
|
|
|
+ * @method static \Illuminate\Database\Eloquent\Builder|MainShopOrder whereId($value)
|
|
|
|
|
+ * @method static \Illuminate\Database\Eloquent\Builder|MainShopOrder whereIsBank($value)
|
|
|
|
|
+ * @method static \Illuminate\Database\Eloquent\Builder|MainShopOrder whereIsClearing($value)
|
|
|
|
|
+ * @method static \Illuminate\Database\Eloquent\Builder|MainShopOrder whereIsReport($value)
|
|
|
|
|
+ * @method static \Illuminate\Database\Eloquent\Builder|MainShopOrder whereMId($value)
|
|
|
|
|
+ * @method static \Illuminate\Database\Eloquent\Builder|MainShopOrder wherePayCodeSource($value)
|
|
|
|
|
+ * @method static \Illuminate\Database\Eloquent\Builder|MainShopOrder wherePayMoney($value)
|
|
|
|
|
+ * @method static \Illuminate\Database\Eloquent\Builder|MainShopOrder wherePaySn($value)
|
|
|
|
|
+ * @method static \Illuminate\Database\Eloquent\Builder|MainShopOrder wherePayType($value)
|
|
|
|
|
+ * @method static \Illuminate\Database\Eloquent\Builder|MainShopOrder whereReturnSn($value)
|
|
|
|
|
+ * @method static \Illuminate\Database\Eloquent\Builder|MainShopOrder whereRsSn($value)
|
|
|
|
|
+ * @method static \Illuminate\Database\Eloquent\Builder|MainShopOrder whereServiceMoney($value)
|
|
|
|
|
+ * @method static \Illuminate\Database\Eloquent\Builder|MainShopOrder whereShopId($value)
|
|
|
|
|
+ * @method static \Illuminate\Database\Eloquent\Builder|MainShopOrder whereStatus($value)
|
|
|
|
|
+ * @method static \Illuminate\Database\Eloquent\Builder|MainShopOrder whereUpdatedAt($value)
|
|
|
|
|
+ * @property int|null $food_id 点餐订单ID
|
|
|
|
|
+ * @method static \Illuminate\Database\Eloquent\Builder|MainShopOrder whereFoodId($value)
|
|
|
|
|
+ * @mixin \Eloquent
|
|
|
|
|
+ */
|
|
|
|
|
+class MainShopOrder extends Model
|
|
|
|
|
+{
|
|
|
|
|
+ protected $connection = 'mysqlTwo';
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * The table associated with the model.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @var string
|
|
|
|
|
+ */
|
|
|
|
|
+ protected $table = 'shop_orders';
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * The primary key associated with the table.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @var string
|
|
|
|
|
+ */
|
|
|
|
|
+ protected $primaryKey = 'id';
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Indicates if the model should be timestamped.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @var bool
|
|
|
|
|
+ */
|
|
|
|
|
+ public $timestamps = true;
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 不能被批量赋值的属性
|
|
|
|
|
+ *
|
|
|
|
|
+ * @var array
|
|
|
|
|
+ */
|
|
|
|
|
+ protected $guarded = [ 'id', 'updated_at', 'created_at'];
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 为数组 / JSON 序列化准备日期。
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param DateTimeInterface $date
|
|
|
|
|
+ * @return string
|
|
|
|
|
+ */
|
|
|
|
|
+ protected function serializeDate(DateTimeInterface $date)
|
|
|
|
|
+ {
|
|
|
|
|
+ return $date->format($this->dateFormat ?: 'Y-m-d H:i:s');
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+}
|