| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- <?php
- namespace app\model\user;
- use app\extra\basic\Model;
- use app\model\cutter\CutterApply;
- use app\model\cutter\CutterOrder;
- use think\model\relation\HasMany;
- use think\model\relation\HasOne;
- /**
- * 用户
- */
- class User extends Model
- {
- /**
- * The connection name for the model.
- *
- * @var string|null
- */
- protected $connection = 'mysql';
-
- /**
- * The table associated with the model.
- *
- * @var string
- */
- protected string $table = "user";
-
- /**
- * The primary key associated with the table.
- *
- * @var string
- */
- protected string $primaryKey = "uid";
-
- /**
- * Indicates if the model should be timestamped.
- *
- * @var bool
- */
- public bool $timestamps = false;
- public function cutterApply(): HasOne
- {
- return $this->hasOne(CutterApply::class,"uid","uid");
- }
- public function level(): HasOne
- {
- return $this->hasOne(UserLevel::class,"id","level");
- }
- public function cutterOrder(): HasMany
- {
- return $this->hasMany(CutterOrder::class,"uid","uid");
- }
- public function brokerage(): HasMany
- {
- return $this->hasMany(UserBrokerage::class,"uid","uid");
- }
- }
|