'userId', self::RECEIVE_LOGIN_NAME => 'loginName' ]; /** * 分账来源类型: 商城 */ const FROM_STORE = 0; /** * 分账来源类型: 平台 */ const FROM_PLATFORM = 1; /** * 分账来源类型: 推荐 */ const FROM_RECOMMEND = 2; /** * 分账来源类型: 服务商 */ const FROM_SERVICE_PROVIDER = 3; /** * 分账来源类型: 商城间分销 */ const FROM_STORE_TO_STORE = 4; public static $validNewFrom = [ self::FROM_STORE, self::FROM_RECOMMEND, self::FROM_SERVICE_PROVIDER, self::FROM_PLATFORM, self::FROM_STORE_TO_STORE ]; public function behaviors() { return [ [ 'class' => TimestampBehavior::class, 'attributes' => [ ActiveRecord::EVENT_BEFORE_INSERT => ['updated_at', 'created_at'], ActiveRecord::EVENT_BEFORE_UPDATE => 'updated_at' ] ] ]; } /** * {@inheritdoc} */ public function rules() { return [ [['store_id', 'is_delete', 'created_at', 'updated_at', 'type', 'is_pay', 'from', 'user_id'], 'integer'], [['amount', 'rate'], 'number'], [['name', 'description', 'account', 'order_no', 'err_code', 'err_code_des', 'remark'], 'string', 'max' => 255], ]; } /** * {@inheritdoc} */ public function attributeLabels() { return [ 'id' => 'ID', 'store_id' => 'Store ID', 'name' => '接收方姓名', 'type' => '分账接收方类型,1:user_id 1:login_name', 'description' => '分账描述', 'user_id' => 'USER ID', 'account' => '分账接收方账户', 'order_no' => '订单号', 'is_pay' => '是否支付', 'amount' => '金额', 'rate' => '比例', 'from' => '0:店铺分销,1:saas平台分销, 2:推荐分账,3:服务商分账 4:商城级分账', 'err_code' => '分账错误代码', 'err_code_des' => '分账错误信息', 'remark' => '标注类型,例如:店铺分销', 'is_delete' => 'Is Delete', 'created_at' => 'Add Time', 'updated_at' => 'Update Time', ]; } }