RecodeModel.php 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. namespace App\Models;
  3. /**
  4. * App\Models\RecodeModel
  5. *
  6. * @property int $id 主键
  7. * @property int $uid 用户id
  8. * @property int $partner_id 卖室友卡片id
  9. * @property int $create_at 操作时间
  10. * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\RecodeModel newModelQuery()
  11. * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\RecodeModel newQuery()
  12. * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\RecodeModel query()
  13. * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\RecodeModel whereCreateAt($value)
  14. * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\RecodeModel whereId($value)
  15. * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\RecodeModel wherePartnerId($value)
  16. * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\RecodeModel whereUid($value)
  17. * @mixin \Eloquent
  18. */
  19. class RecodeModel extends Model
  20. {
  21. protected $table = 'kdgx_partner_charge_recode';
  22. public $timestamps = false;
  23. public $fillable = ['uid', 'partner_id', 'create_at'];
  24. /**
  25. * 是否解锁卡片
  26. * @param int $uid
  27. * @param int $partner_id
  28. * @return bool
  29. */
  30. public function isLock(int $uid, int $partner_id)
  31. {
  32. if (
  33. $this->where([
  34. ['uid', $uid],
  35. ['partner_id', $partner_id]
  36. ])->exists()
  37. ) {
  38. return true;
  39. } else {
  40. return false;
  41. }
  42. }
  43. }