CommissionForm.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <?php
  2. namespace backend\models\forms;
  3. use Yii;
  4. use yii\base\Model;
  5. /**
  6. * 返佣规则
  7. */
  8. class CommissionForm extends Model
  9. {
  10. public $id;
  11. public $login;
  12. public $member_id;
  13. public $forex;
  14. public $metal;
  15. public $cfd;
  16. public $gold;
  17. public $silver;
  18. public $wy;
  19. public $in_time;
  20. /**
  21. * @inheritdoc
  22. */
  23. public function rules()
  24. {
  25. return [
  26. // admin_batch_set
  27. [['forex', 'metal', 'cfd', 'gold', 'silver', 'wy'], 'number', 'on' => 'admin_batch_set'],
  28. ];
  29. }
  30. /**
  31. * @inheritdoc
  32. * @return array
  33. */
  34. public function scenarios()
  35. {
  36. $scenarios = parent::scenarios();
  37. $scenarios['admin_batch_set'] = ['id', 'login', 'member_id', 'forex', 'metal', 'cfd', 'gold', 'silver', 'wy', 'in_time'];
  38. return $scenarios;
  39. }
  40. /**
  41. * @inheritdoc
  42. */
  43. public function attributeLabels()
  44. {
  45. if (in_array($this->getScenario(), ['admin_batch_set'])) {
  46. return [
  47. 'forex' => 'FOREX',
  48. 'metal' => 'METAL',
  49. 'cfd' => 'CFD',
  50. 'gold' => '黄金',
  51. 'silver' => '白银',
  52. 'wy' => '外佣',
  53. ];
  54. }
  55. return [];
  56. }
  57. }