WorkerGoodsExt.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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 "{{%worker_goods_ext}}".
  14. *
  15. * @property integer $id
  16. * @property integer $store_id
  17. * @property integer $goods_id
  18. * @property integer $payment_type
  19. * @property string $profit_base
  20. * @property string $profit_max
  21. * @property integer $created_at
  22. * @property integer $updated_at
  23. * @property string $desc
  24. * @property string $warn
  25. * @property integer $cat_id
  26. * @property string $final_profit
  27. * @property integer $bind_worker
  28. */
  29. class WorkerGoodsExt extends \yii\db\ActiveRecord
  30. {
  31. /**
  32. * @inheritdoc
  33. */
  34. public static function tableName()
  35. {
  36. return '{{%worker_goods_ext}}';
  37. }
  38. public function behaviors()
  39. {
  40. return [
  41. [
  42. 'class' => TimestampBehavior::class,
  43. ]
  44. ];
  45. }
  46. public function beforeSave($insert)
  47. {
  48. return parent::beforeSave($insert);
  49. }
  50. public function afterSave($insert, $changedAttributes)
  51. {
  52. parent::afterSave($insert, $changedAttributes); // TODO: Change the autogenerated stub
  53. (new DiyCommon)->JobBehaviors($this->store_id, StoreSyncExtLog::TYPE_WORKER_CONFIG_GOODS);
  54. }
  55. }