CommissionRecord.php 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <?php
  2. namespace backend\models;
  3. use Yii;
  4. /**
  5. * This is the model class for table "crm_commission_record".
  6. *
  7. * @property integer $id
  8. * @property integer $ib_id
  9. * @property integer $ib_login
  10. * @property integer $user_login
  11. * @property integer $trade_ticket
  12. * @property integer $trade_type
  13. * @property double $trade_volume
  14. * @property string $commission_rule
  15. * @property string $commission
  16. * @property integer $in_time
  17. */
  18. class CommissionRecord extends \yii\db\ActiveRecord
  19. {
  20. /**
  21. * @inheritdoc
  22. */
  23. public static function tableName()
  24. {
  25. return 'crm_commission_record';
  26. }
  27. /**
  28. * @return \yii\db\Connection the database connection used by this AR class.
  29. */
  30. public static function getDb()
  31. {
  32. return Yii::$app->get('dbXcrm');
  33. }
  34. /**
  35. * @inheritdoc
  36. */
  37. public function rules()
  38. {
  39. return [
  40. [['ib_id', 'ib_login', 'user_login', 'trade_ticket', 'trade_type', 'trade_volume', 'commission_rule', 'commission', 'in_time'], 'required'],
  41. [['ib_id', 'ib_login', 'user_login', 'trade_ticket', 'trade_type', 'in_time'], 'integer'],
  42. [['trade_volume', 'commission'], 'number'],
  43. [['commission_rule'], 'string', 'max' => 255],
  44. ];
  45. }
  46. /**
  47. * @inheritdoc
  48. */
  49. public function attributeLabels()
  50. {
  51. return [
  52. 'id' => 'ID',
  53. 'ib_id' => 'Ib ID',
  54. 'ib_login' => 'Ib Login',
  55. 'user_login' => 'User Login',
  56. 'trade_ticket' => 'Trade Ticket',
  57. 'trade_type' => 'Trade Type',
  58. 'trade_volume' => 'Trade Volume',
  59. 'commission_rule' => 'Commission Rule',
  60. 'commission' => 'Commission',
  61. 'in_time' => 'In Time',
  62. ];
  63. }
  64. }