CloudGoodsBind.php 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <?php
  2. /**
  3. * 厦门云联储网络科技有限公司
  4. * https://www.baokuaiyun.com
  5. * Copyright (c) 2023 爆块云 All rights reserved.
  6. */
  7. namespace app\models;
  8. use Yii;
  9. /**
  10. * This is the model class for table "{{%cloud_goods_bind}}".
  11. *
  12. * @property integer $id
  13. * @property integer $cloud_goods_id
  14. * @property integer $cloud_attr_id
  15. * @property integer $cloud_supplier_id
  16. * @property integer $goods_id
  17. * @property integer $attr_id
  18. * @property integer $is_delete
  19. * @property integer $created_at
  20. */
  21. class CloudGoodsBind extends \yii\db\ActiveRecord
  22. {
  23. /**
  24. * @inheritdoc
  25. */
  26. public static function tableName()
  27. {
  28. return '{{%cloud_goods_bind}}';
  29. }
  30. /**
  31. * @inheritdoc
  32. */
  33. public function rules()
  34. {
  35. return [
  36. [['cloud_goods_id', 'cloud_attr_id', 'cloud_supplier_id', 'goods_id', 'store_id'], 'integer'],
  37. ['attr_id','validateAttrId']
  38. ];
  39. }
  40. public function validateAttrId(){
  41. if(!is_int($this->attr_id) && !is_string($this->attr_id)){
  42. $this->addError('attr_id', 'attr_id type error');
  43. }
  44. }
  45. /**
  46. * @inheritdoc
  47. */
  48. public function attributeLabels()
  49. {
  50. return [
  51. 'id' => 'ID',
  52. 'cloud_goods_id' => '云仓商品id',
  53. 'cloud_attr_id' => '云仓商品属性id',
  54. 'cloud_supplier_id' => '云仓供货商id',
  55. 'store_id' => '店铺id',
  56. 'goods_id' => '云联储商品id',
  57. 'attr_id' => '云联储商品属性id',
  58. 'is_delete' => 'Is Delete',
  59. 'created_at' => 'Addtime',
  60. ];
  61. }
  62. }