QiShangTongBalanceLog.php 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <?php
  2. namespace addons\QiShangTong\common\models;
  3. use common\models\mall\Mall;
  4. use Yii;
  5. /**
  6. * This is the model class for table "qimall_addons_qi_shang_tong_balance_log".
  7. *
  8. * @property int $id ID
  9. * @property int $mall_id 商城ID
  10. * @property int $created_at 创建时间
  11. * @property int $updated_at 更新时间
  12. * @property int $status 状态
  13. * @property int $amount 异动金额
  14. * @property int $before_amount 异动金额
  15. * @property int $after_amount 异动金额
  16. * @property string $remark 异动备注
  17. * @property int $type 异动类型
  18. * @property int $direction 1进2出
  19. * @property string $order_no 订单编号
  20. * @property string $addons 订单编号
  21. */
  22. class QiShangTongBalanceLog extends \common\models\base\BaseActiveRecord
  23. {
  24. /**
  25. * {@inheritdoc}
  26. */
  27. public static function tableName()
  28. {
  29. return 'qimall_addons_qi_shang_tong_balance_log';
  30. }
  31. /**
  32. * {@inheritdoc}
  33. */
  34. public function rules()
  35. {
  36. return [
  37. [['mall_id', 'created_at', 'updated_at', 'status', 'amount', 'type', 'direction', 'before_amount', 'after_amount'], 'integer'],
  38. [['remark'], 'string', 'max' => 1000],
  39. [['order_no'], 'string', 'max' => 30],
  40. [['addons'], 'string', 'max' => 50],
  41. ];
  42. }
  43. /**
  44. * {@inheritdoc}
  45. */
  46. public function attributeLabels()
  47. {
  48. return [
  49. 'id' => 'ID',
  50. 'mall_id' => 'Mall ID',
  51. 'created_at' => 'Created At',
  52. 'updated_at' => 'Updated At',
  53. 'status' => 'Status',
  54. 'amount' => 'Amount',
  55. 'remark' => 'Remark',
  56. 'type' => 'Type',
  57. 'direction' => 'Direction',
  58. 'order_no' => 'Order No',
  59. ];
  60. }
  61. public function getMall()
  62. {
  63. return $this->hasOne(Mall::class, ['id' => 'mall_id']);
  64. }
  65. }