Client.php 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <?php
  2. namespace common\models\oauth2;
  3. use Yii;
  4. /**
  5. * This is the model class for table "{{%oauth2_client}}".
  6. *
  7. * @property int $id
  8. * @property int|null $merchant_id 商户id
  9. * @property string $title 标题
  10. * @property string $client_id
  11. * @property string $client_secret
  12. * @property string|null $redirect_uri 回调Url
  13. * @property string|null $remark 备注
  14. * @property string|null $group 组别
  15. * @property string|null $scope 授权
  16. * @property int|null $status 状态[-1:删除;0:禁用;1启用]
  17. * @property int|null $created_at 创建时间
  18. * @property int|null $updated_at 修改时间
  19. */
  20. class Client extends \common\models\base\BaseModel
  21. {
  22. /**
  23. * {@inheritdoc}
  24. */
  25. public static function tableName()
  26. {
  27. return '{{%oauth2_client}}';
  28. }
  29. /**
  30. * {@inheritdoc}
  31. */
  32. public function rules()
  33. {
  34. return [
  35. [['client_id'], 'unique'],
  36. [['merchant_id', 'status', 'created_at', 'updated_at'], 'integer'],
  37. [['client_id', 'client_secret', 'title'], 'required'],
  38. [['scope'], 'safe'],
  39. [['title'], 'string', 'max' => 100],
  40. [['client_id', 'client_secret'], 'string', 'max' => 64],
  41. [['redirect_uri'], 'string', 'max' => 2000],
  42. [['remark'], 'string', 'max' => 200],
  43. [['group'], 'string', 'max' => 30],
  44. ];
  45. }
  46. /**
  47. * {@inheritdoc}
  48. */
  49. public function attributeLabels()
  50. {
  51. return [
  52. 'id' => 'ID',
  53. 'merchant_id' => '商户id',
  54. 'title' => '授权对象',
  55. 'client_id' => 'Client ID',
  56. 'client_secret' => 'Client Secret',
  57. 'redirect_uri' => '回调地址',
  58. 'remark' => '备注',
  59. 'group' => '组别',
  60. 'scope' => '授权',
  61. 'status' => '状态',
  62. 'created_at' => '创建时间',
  63. 'updated_at' => '修改时间',
  64. ];
  65. }
  66. }
粤ICP备19079148号