| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- <?php
- namespace mall\models\groupBuy;
- use mall\models\BaseForm;
- /**
- * 开团下单表单校验
- * 结算页提交:校验团购商品、数量、配送方式及收货信息
- * 跑腿字段与混合单 create-mix-order 对齐,供后端按同一套规则重算运费
- */
- class CreateGroupBuyForm extends BaseForm
- {
- public $activityGoodsId;
- public $goodsNum;
- public $sendType;
- public $receiveUserName;
- public $receiveMobile;
- public $address;
- public $floor;
- public $city;
- public $dist;
- public $province;
- public $long;
- public $lat;
- public $showAddress;
- public $remark;
- public $reachDate;
- public $reachPeriod;
- public $bookMobile;
- public $needCard;
- public $cardInfo;
- public $anonymity;
- /** 跑腿平台标识,如 shansong/didi;后端报价用,不信任前端金额 */
- public $deliveryPlatform;
- /** 跑腿平台多报价识别 id(货拉拉车型、滴滴括号内容等) */
- public $deliveryBracketContent;
- public function rules()
- {
- return [
- ['activityGoodsId', 'required', 'message' => '请选择团购商品'],
- ['activityGoodsId', 'integer', 'min' => 1, 'message' => '团购商品无效'],
- ['goodsNum', 'default', 'value' => 1],
- ['goodsNum', 'integer', 'min' => 1, 'max' => 99, 'message' => '购买数量无效'],
- ['sendType', 'default', 'value' => 1],
- ['sendType', 'integer', 'min' => 0, 'max' => 4, 'message' => '配送方式无效', 'tooSmall' => '配送方式无效', 'tooBig' => '配送方式无效'],
- ['needCard', 'default', 'value' => 0],
- ['needCard', 'integer'],
- ['anonymity', 'default', 'value' => 0],
- ['anonymity', 'integer'],
- [['receiveUserName', 'receiveMobile', 'address', 'floor', 'city', 'dist', 'province', 'long', 'lat', 'showAddress', 'remark', 'reachDate', 'reachPeriod', 'bookMobile', 'cardInfo', 'deliveryPlatform', 'deliveryBracketContent'], 'safe'],
- ];
- }
- public function attributeLabels()
- {
- return [
- 'activityGoodsId' => '团购商品',
- 'goodsNum' => '数量',
- 'sendType' => '配送方式',
- 'deliveryPlatform' => '跑腿平台',
- 'deliveryBracketContent' => '跑腿报价标识',
- ];
- }
- }
|