You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

63 lines
1.3 KiB

  1. <?php
  2. namespace backend\modules\shop\models\ars;
  3. use yii\behaviors\TimestampBehavior;
  4. use yii\redis\ActiveRecord;
  5. /**
  6. * Class WxPayConfig
  7. * @package backend\modules\shop\models\ars
  8. * @property int $id
  9. * @property int $user_id 用户id
  10. * @property int $mch_id 商户号
  11. * @property string $key 支付秘钥
  12. * @property string $cert_path cert文件路径
  13. * @property string $key_path key文件路径
  14. */
  15. class WxPayConfig extends ActiveRecord
  16. {
  17. /**
  18. * 主键 默认为 id
  19. *
  20. * @return array|string[]
  21. */
  22. public static function primaryKey()
  23. {
  24. return ['id'];
  25. }
  26. /**
  27. * 模型对应记录的属性列表
  28. *
  29. * @return array
  30. */
  31. public function attributes()
  32. {
  33. return ['id', 'user_id', 'mch_id', 'key', 'cert_path', 'key_path', 'created_at', 'updated_at'];
  34. }
  35. /**
  36. * @author linyao
  37. * @email 602604991@qq.com
  38. * @created Nov 8, 2019
  39. *
  40. * 行为存储创建时间和更新时间
  41. */
  42. public function behaviors()
  43. {
  44. return [
  45. [
  46. 'class' => TimestampBehavior::className(),
  47. 'createdAtAttribute' => 'created_at',
  48. 'updatedAtAttribute' => 'updated_at',
  49. 'value' => function () {
  50. return time();
  51. },
  52. ],
  53. ];
  54. }
  55. }