| 1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- <?php
- namespace App\Module\System\Models;
- use Dcat\Admin\Traits\HasDateTimeFormatter;
- use Illuminate\Database\Eloquent\Model;
- use Illuminate\Database\Eloquent\SoftDeletes;
- /**
- * field start
- * @property int $id
- * @property string $name 地址
- * @property int $status 状态
- * @property string $address 地址
- * @property \Carbon\Carbon $created_at 创建时间
- * @property \Carbon\Carbon $updated_at 更新时间
- * @property \Carbon\Carbon $deleted_at 删除时间
- * field end
- */
- class ReceiveAddress extends Model
- {
- //attrlist start
- protected $fillable = [
- 'id',
- 'name',
- 'status',
- 'address',
- ];
- // attrlist end
- use HasDateTimeFormatter;
- use SoftDeletes;
- protected $table = 'receive_address';
- /**
- * @return \Illuminate\Database\Eloquent\Collection
- * 随机获取系统地址
- */
- public static function getAddress()
- {
- $query = static::query();
- return $query->inRandomOrder()->limit(1)->first();
- }
- }
|