OrderAfterSaleForm.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. namespace addons\TinyShop\common\forms;
  3. use addons\TinyShop\common\models\order\AfterSale;
  4. /**
  5. * Class OrderAfterSaleForm
  6. * @package addons\TinyShop\common\forms
  7. * @author jianyan74 <751393839@qq.com>
  8. */
  9. class OrderAfterSaleForm extends AfterSale
  10. {
  11. /**
  12. * @return array
  13. */
  14. public function rules()
  15. {
  16. return [
  17. [['id'], 'required'],
  18. [['refund_reason', 'refund_type'], 'required', 'on' => 'apply'],
  19. [['refund_pay_type', 'refund_money'], 'required', 'on' => 'affirmRefund'],
  20. [['member_express_no', 'member_express_company'], 'required', 'on' => 'salesReturn'],
  21. [['merchant_express_mobile', 'member_express_mobile'], 'string', 'max' => 20],
  22. [['refund_type'], 'integer'],
  23. [['refund_evidence'], 'safe'],
  24. [['refund_apply_money' ,'refund_money'], 'number', 'min' => 0],
  25. [['refund_reason', 'refund_explain', 'member_express_no', 'member_express_company'], 'string', 'max' => 200],
  26. ];
  27. }
  28. /**
  29. * 场景
  30. *
  31. * @return array
  32. */
  33. public function scenarios()
  34. {
  35. return [
  36. 'default' => array_keys($this->attributeLabels()),
  37. 'apply' => array_keys($this->attributeLabels()),
  38. 'salesReturn' => array_keys($this->attributeLabels()),
  39. 'affirmRefund' => array_keys($this->attributeLabels()),
  40. ];
  41. }
  42. }
粤ICP备19079148号