|
@@ -2,18 +2,76 @@
|
|
|
|
|
|
|
|
namespace App\Models;
|
|
namespace App\Models;
|
|
|
|
|
|
|
|
|
|
+use DateTimeInterface;
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
|
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* App\Models\TableNumber
|
|
* App\Models\TableNumber
|
|
|
*
|
|
*
|
|
|
|
|
+ * @property int $id
|
|
|
|
|
+ * @property int $shop_id 店铺ID
|
|
|
|
|
+ * @property int $number 桌号
|
|
|
|
|
+ * @property string $table_code 桌号码
|
|
|
|
|
+ * @property int|null $status 状态
|
|
|
|
|
+ * @property \Illuminate\Support\Carbon|null $created_at
|
|
|
|
|
+ * @property \Illuminate\Support\Carbon|null $updated_at
|
|
|
|
|
+ * @property string|null $title 标题
|
|
|
|
|
+ * @property int|null $is_del
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|TableNumber newModelQuery()
|
|
* @method static \Illuminate\Database\Eloquent\Builder|TableNumber newModelQuery()
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|TableNumber newQuery()
|
|
* @method static \Illuminate\Database\Eloquent\Builder|TableNumber newQuery()
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|TableNumber query()
|
|
* @method static \Illuminate\Database\Eloquent\Builder|TableNumber query()
|
|
|
|
|
+ * @method static \Illuminate\Database\Eloquent\Builder|TableNumber whereCreatedAt($value)
|
|
|
|
|
+ * @method static \Illuminate\Database\Eloquent\Builder|TableNumber whereId($value)
|
|
|
|
|
+ * @method static \Illuminate\Database\Eloquent\Builder|TableNumber whereIsDel($value)
|
|
|
|
|
+ * @method static \Illuminate\Database\Eloquent\Builder|TableNumber whereNumber($value)
|
|
|
|
|
+ * @method static \Illuminate\Database\Eloquent\Builder|TableNumber whereShopId($value)
|
|
|
|
|
+ * @method static \Illuminate\Database\Eloquent\Builder|TableNumber whereStatus($value)
|
|
|
|
|
+ * @method static \Illuminate\Database\Eloquent\Builder|TableNumber whereTableCode($value)
|
|
|
|
|
+ * @method static \Illuminate\Database\Eloquent\Builder|TableNumber whereTitle($value)
|
|
|
|
|
+ * @method static \Illuminate\Database\Eloquent\Builder|TableNumber whereUpdatedAt($value)
|
|
|
* @mixin \Eloquent
|
|
* @mixin \Eloquent
|
|
|
*/
|
|
*/
|
|
|
class TableNumber extends Model
|
|
class TableNumber extends Model
|
|
|
{
|
|
{
|
|
|
- use HasFactory;
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * The table associated with the model.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @var string
|
|
|
|
|
+ */
|
|
|
|
|
+ protected $table = 'table_number';
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 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');
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|