BookingGoodsExt.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <?php
  2. /**
  3. * 厦门云联储网络科技有限公司
  4. * https://www.baokuaiyun.com
  5. * Copyright (c) 2023 爆块云 All rights reserved.
  6. */
  7. namespace app\models;
  8. use app\jobs\storeSync\DiyCommon;
  9. use Yii;
  10. use yii\behaviors\TimestampBehavior;
  11. use yii\db\ActiveRecord;
  12. /**
  13. * This is the model class for table "{{%booking_goods_ext}}".
  14. *
  15. * @property integer $id
  16. * @property integer $store_id
  17. * @property integer $goods_id
  18. * @property integer $created_at
  19. * @property integer $updated_at
  20. * @property integer $cat_id
  21. */
  22. class BookingGoodsExt extends \yii\db\ActiveRecord
  23. {
  24. /**
  25. * @inheritdoc
  26. */
  27. public static function tableName()
  28. {
  29. return '{{%booking_goods_ext}}';
  30. }
  31. public function behaviors()
  32. {
  33. return [
  34. [
  35. 'class' => TimestampBehavior::class,
  36. ]
  37. ];
  38. }
  39. public function beforeSave($insert)
  40. {
  41. return parent::beforeSave($insert);
  42. }
  43. public function afterSave($insert, $changedAttributes)
  44. {
  45. parent::afterSave($insert, $changedAttributes); // TODO: Change the autogenerated stub
  46. (new DiyCommon)->JobBehaviors($this->store_id, StoreSyncExtLog::TYPE_BOOKING_GOODS);
  47. }
  48. }