'ID', 'mall_id' => 'Mall ID', 'mch_id' => 'Mch ID', 'name' => '包邮规则名称', 'type' => 'Type', 'price' => '包邮金额', 'status' => '是否默认', 'detail' => 'Detail', 'is_delete' => 'Is Delete', 'created_at' => 'Created At', 'updated_at' => 'Updated At', 'deleted_at' => 'Deleted At', ]; } public function decodeDetail() { $detail = Yii::$app->serializer->decode($this->detail); if (!isset($detail[0]['condition'])) { $newItem['condition'] = $this->price; $newItem['list'] = $detail; $detail = [$newItem]; } return $detail; } public function getTypeText() { switch ($this->type) { case 1: return '订单满额包邮'; case 2: return '订单满件包邮'; case 3: return '单商品满额包邮'; case 4: return '单商品满件包邮'; default: return ''; } } }