255], ['type', 'default', 'value' => 1,], ]; } /** * @inheritdoc */ public function attributeLabels() { return [ 'id' => 'ID', 'store_id' => '商城id', 'pic_url' => '图片url', 'title' => '标题', 'page_url' => '页面路径', 'sort' => '排序,升序', 'created_at' => '添加时间', 'is_delete' => '是否删除:0=未删除,1=已删除', 'type' => '类型1 => 商城,2 => 点餐', 'open_type' => 'Open Type', ]; } /** * @return array */ public function saveBanner() { if ($this->validate()) { if ($this->save()) { return [ 'code' => 0, 'msg' => '成功' ]; } else { return [ 'code' => 1, 'msg' => '失败' ]; } } else { return $this->errors[0]; } } }