|
@@ -321,5 +321,102 @@ class General extends Base
|
|
|
}
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
+ * @title 积分兑换
|
|
|
+ * @desc 积分兑换
|
|
|
+ * @author qc
|
|
|
+ * @url /api/General/integralConvert
|
|
|
+ * @method POST
|
|
|
+ * @tag 积分兑换
|
|
|
+ * @header name:Authorization require:1 desc:Token
|
|
|
+ * @param name:title type:string require:1 default:-- desc:标题
|
|
|
+ * @param name:desc type:string require:1 default:-- desc:描述
|
|
|
+ * @param name:image type:string require:1 default:-- desc:图片(1张)
|
|
|
+ */
|
|
|
+ public function integralConvert()
|
|
|
+ {
|
|
|
+ $title = input('post.title');
|
|
|
+ $desc = input('post.desc');
|
|
|
+ $image = input('post.image');
|
|
|
+ $info = [
|
|
|
+ 'user_id' => $this->uid,
|
|
|
+ 'title' =>$title,
|
|
|
+ 'desc' =>$desc,
|
|
|
+ 'image' =>$image,
|
|
|
+ ];
|
|
|
+ Db::name('integral_convert')->insert($info);
|
|
|
+ $this->success('ok',['已提交等待审核']);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @title 积分兑换详情
|
|
|
+ * @desc 积分兑换详情
|
|
|
+ * @author qc
|
|
|
+ * @url /api/General/getIntegralConvertDetail
|
|
|
+ * @method POST
|
|
|
+ * @tag
|
|
|
+ * @header name:Authorization require:1 desc:Token
|
|
|
+ * @param name:id type:int : default:1 desc:记录id
|
|
|
+ * @return name:title type:string require:1 default:-- desc:标题
|
|
|
+ * @return name:desc type:string require:1 default:-- desc:描述
|
|
|
+ * @return name:image type:string require:1 default:-- desc:图片(1张)
|
|
|
+ * @return name:sh_status type:int require:1 default:-- desc:审核状态(0 待审核1审核通过2审核不通过)
|
|
|
+ * @return name:ck_time type:string require:1 default:-- desc:审核时间
|
|
|
+ * @return name:remark type:string require:1 default:-- desc:审核备注
|
|
|
+ * @return name:integral type:int require:1 default:-- desc:积分数
|
|
|
+ */
|
|
|
+ public function getIntegralConvertDetail()
|
|
|
+ {
|
|
|
+ $id = input('post.id');
|
|
|
+ $detail = Db::name('integral_convert')->where(['user_id'=>$this->uid,'id'=>$id])->find();
|
|
|
+ $this->success('ok',['detail'=>$detail]);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @title 积分兑换记录
|
|
|
+ * @desc 积分兑换记录
|
|
|
+ * @author qc
|
|
|
+ * @url /api/General/getIntegralConvertList
|
|
|
+ * @method POST
|
|
|
+ * @tag 积分兑换
|
|
|
+ * @header name:Authorization require:1 desc:Token
|
|
|
+ * @param name:page type:int : default:1 desc:页数
|
|
|
+ * @param name:page_num type:int : default:20 desc:每页数
|
|
|
+ * @return name:title type:string require:1 default:-- desc:标题
|
|
|
+ * @return name:desc type:string require:1 default:-- desc:描述
|
|
|
+ * @return name:image type:string require:1 default:-- desc:图片(1张)
|
|
|
+ * @return name:sh_status type:int require:1 default:-- desc:审核状态(0 待审核1审核通过2审核不通过)
|
|
|
+ * @return name:ck_time type:string require:1 default:-- desc:审核时间
|
|
|
+ * @return name:remark type:string require:1 default:-- desc:审核备注
|
|
|
+ * @return name:integral type:int require:1 default:-- desc:积分数
|
|
|
+ */
|
|
|
+ public function getIntegralConvertList()
|
|
|
+ {
|
|
|
+ $list = Db::name('integral_convert')->where(['user_id'=>$this->uid,'is_deleted'=>0])
|
|
|
+ ->order('id desc')
|
|
|
+ ->limit($this->off_set,$this->page_num)
|
|
|
+ ->select();
|
|
|
+ $this->success('ok',['list'=>$list]);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @title 删除积分兑换记录
|
|
|
+ * @desc 删除积分兑换记录
|
|
|
+ * @author qc
|
|
|
+ * @url /api/General/delIntegralConvert
|
|
|
+ * @method POST
|
|
|
+ * @tag 积分兑换
|
|
|
+ * @header name:Authorization require:1 desc:Token
|
|
|
+ * @param name:id type:int require:1 default:-- desc:积分兑换记录id
|
|
|
+
|
|
|
+ */
|
|
|
+ public function delIntegralConvert()
|
|
|
+ {
|
|
|
+ $id = input('post.id');
|
|
|
+ Db::name('integral_convert')->where(['user_id'=>$this->uid,'id'=>$id])->update(['is_deleted'=>1]);
|
|
|
+ $this->success('删除成功');
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
}
|