UserTeamProfitStatisticsLog.php 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. <?php
  2. namespace common\models\user;
  3. use common\enums\AddonsEnum;
  4. use common\enums\OrderStatusEnum;
  5. use common\enums\RabbitMqEnum;
  6. use common\enums\StatusEnum;
  7. use common\models\mall\Mall;
  8. use common\models\mall\MallAddons;
  9. use common\models\order\Order;
  10. use common\models\order\OrderRefund;
  11. use Exception;
  12. use Yii;
  13. /**
  14. * This is the model class for table "qimall_user_team_profit_statistics".
  15. *
  16. * @property int $id
  17. * @property int $mall_id 商城id
  18. * @property int $user_id 用户id
  19. * @property float $children_order_pay_profit 下级团队订单支付总利润(不包含自己)
  20. * @property float $team_order_pay_profit 团队订单支付总利润(包含自己)
  21. * @property float $children_order_finish_profit 下级团队订单完成总利润(不包含自己)
  22. * @property float $team_order_finish_profit 团队订单完成总利润(包含自己)
  23. * @property int|null $created_at 添加时间
  24. * @property int|null $updated_at 修改时间
  25. */
  26. class UserTeamProfitStatisticsLog extends \common\models\base\BaseActiveRecord
  27. {
  28. /**
  29. * {@inheritdoc}
  30. */
  31. public static function tableName()
  32. {
  33. return 'qimall_user_team_profit_statistics_log';
  34. }
  35. /**
  36. * {@inheritdoc}
  37. */
  38. public function rules()
  39. {
  40. return [
  41. [['mall_id', 'goods_id', 'order_detail_id', 'order_id', 'status', 'created_at', 'updated_at'], 'integer'],
  42. ];
  43. }
  44. /**
  45. * {@inheritdoc}
  46. */
  47. public function attributeLabels()
  48. {
  49. return [
  50. 'id' => 'ID',
  51. 'mall_id' => 'Mall ID',
  52. 'user_id' => 'User ID',
  53. 'children_order_pay_profit' => 'Children Order Pay Profit',
  54. 'team_order_pay_profit' => 'Team Order Pay Profit',
  55. 'children_order_finish_profit' => 'Children Order Finish Profit',
  56. 'team_order_finish_profit' => 'Team Order Finish Profit',
  57. 'created_at' => 'Created At',
  58. 'updated_at' => 'Updated At',
  59. ];
  60. }
  61. public static function setData(array $data)
  62. {
  63. try {
  64. $model = new self();
  65. $model->loadDefaultValues();
  66. if (!$model->load($data, '') || !$model->save()) {
  67. throw new \Exception($model->getErrorMessage());
  68. }
  69. return $model;
  70. } catch (\Exception $e) {
  71. self::setStaticError($e->getMessage());
  72. return false;
  73. }
  74. }
  75. }