作者 郭宇鹏
1 个管道 的构建 通过 耗费 1 秒

'1-4'

... ... @@ -270,6 +270,7 @@ class Article extends BaseApi
->where('pid',$val['id'])
->count();
}
Db::commit();
} catch (Exception $e) {
Db::rollback();
$this->error($e->getMessage());
... ... @@ -465,6 +466,7 @@ class Article extends BaseApi
* @ApiReturn ()
*/
public function setArticleReport(){
Db::startTrans();
try {
//1.获取动态id
$data= $this->get_data_array([
... ...
... ... @@ -40,7 +40,7 @@ class BaseApi extends Api
$data = [];
foreach ($array as $val){
$res = g($val[0],$stu);
if (!isset($res)){
if (!isset($res) || $res == ""){
$this->error($val[1]);
}
$data[$val[0]] = $res;
... ...
<?php
namespace app\api\controller;
use EasyWeChat\Factory;
use think\Db;
use think\Exception;
/**
* 展览相关
* @package app\api\controller
*/
class Exhibition extends BaseApi
{
protected $noNeedLogin = '';
protected $noNeedRight = '*';
/**
* 查询展览时长
* @ApiTitle (查询展览时长)
* @ApiMethod (POST)
* @ApiRoute (/api/exhibition/getExhibitionPrice)
* @ApiReturnParams (name="code", type="integer", required=true, sample="0")
* @ApiReturnParams (name="msg", type="string", required=true, sample="返回成功")
* @ApiReturnParams (name="data", type="object", description="扩展数据返回")
* @ApiReturn ({
"code": 1,
"msg": "查询成功",
"time": "1609748728",
"data": [
{
"id": 1,
"day": "几天",
"price": "价格",
"weigh": "排序",
"createtime": "1970-01-01 08:00:00",
"updatetime": "1970-01-01 08:00:00"
}
]
})
*/
public function getExhibitionPrice(){
//1.查询展览时长
$list = model('exhibition_price')->order('weigh','desc')->select();
//2.返回
$this->success('查询成功',$list);
}
/**
* 发布展览
* @ApiTitle (发布展览)
* @ApiMethod (POST)
* @ApiRoute (/api/exhibition/addExhibition)
* @ApiParams (name="title", type="string", required=true, description="展览标题")
* @ApiParams (name="describe", type="string", required=true, description="展览描述")
* @ApiParams (name="images", type="string", required=true, description="展览图片")
* @ApiParams (name="exhibition_price_id", type="integer", required=true, description="展览价格ID")
* @ApiReturnParams (name="code", type="integer", required=true, sample="0")
* @ApiReturnParams (name="msg", type="string", required=true, sample="返回成功")
* @ApiReturnParams (name="data", type="object", description="扩展数据返回")
* @ApiReturn ({
"code": 1,
"msg": "获取支付成功",
"time": "1609755422",
"data": {
"appId": "wx529923b385fe8f5b",
"nonceStr": "5ff2eb1f1db87",
"package": "prepay_id=wx0418170325184060863236bfe63f350000",
"signType": "MD5",
"paySign": "45258090229C705860FABCF2AD723221",
"timestamp": "1609755423"
}
})
*/
public function addExhibition(){
//1.获取数据
$data = $this->get_data_array([
['title','展览标题不能为空'],
['describe','展览描述不能为空'],
['images','展览图片不能为空'],
['exhibition_price_id','展览价格ID不能为空'],
]);
//2.查询之前发布的展览 删除
$exhibition_list = model('exhibition')->where('user_id',$this->auth->id)->where('createtime','<',time()-3600)->where('status',0)->column('id');
if ($exhibition_list){
model('exhibition')->whereIn('id',$exhibition_list)->delete();
}
//3.查询价格
$exhibition_price = model('exhibition_price')->where('id',$data['exhibition_price_id'])->find();
if (!$exhibition_price){
$this->error('价格不存在');
}
//4.获取图片数据
$files = str_replace('&quot;','"',$data['images']);
$images = implode(',',json_decode($files,true));
//5.重组数据
$data['number'] = time() - mt_rand(10000,99999);
$data['user_id'] = $this->auth->id;
$data['avatar'] = $this->auth->avatar;
$data['nickname'] = $this->auth->nickname;
$data['price'] = $exhibition_price['price'];
$data['images'] = $images;
$data['images_num'] = count(json_decode($files,true));
$data['start_time'] = time();
$data['end_time'] = time() + ($exhibition_price['day'] * (24*60*60));
$data = model('exhibition')->create($data);
//6.获取配置信息
$config = config('EasyWeChat');
$app = Factory::payment($config);
//7.查询用户的第三方登录信息
$fa_third = Db::name('third')->where('user_id',$this->auth->id)->find();
if (!$fa_third)$this->error('第三方授权数据不存在');
//8.统一下单接口
$result = $app->order->unify([
'body' => '送出礼物',
'out_trade_no' => $data['number'],
//'total_fee' => $order['price'] * 100,
'total_fee' => 1,
'notify_url' =>this_url().'/api/exhibition/setWechatNotify', // 支付结果通知网址,如果不设置则会使用配置里的默认地址
'trade_type' => 'JSAPI', // 请对应换成你的支付方式对应的值类型
'openid' => $fa_third['openid'],
]);
//9.判断返回结果
if ($result['result_code'] == 'SUCCESS' && $result['return_code'] == 'SUCCESS') {
$prepayId = $result['prepay_id'];
$jssdk = $app->jssdk;
$config = $jssdk->sdkConfig($prepayId);
$this->success('获取支付成功',$config);
} else {
$this->error('失败',$result);
}
}
/**
* 支付回调
* @ApiMethod (POST)
* @ApiInternal
* @ApiRoute (/api/exhibition/setWechatNotify)
*/
public function setWechatNotify(){
$config = config('EasyWeChat');
$app = Factory::payment($config);
$response = $app->handlePaidNotify(function ($message, $fail) {
//将展览设置已经支付
$order = model('exhibition')->where('number',$message['out_trade_no'])->find();
if (!$order)$fail('订单不存在');
if ($order['status'] == 1)$fail('您的订单已经支付');
$order->status = 1;
$order->save();
});
$response->send(); // Laravel 里请使用:return $response;
}
/**
* 查询展览轮播图
* @ApiTitle (查询展览轮播图)
* @ApiMethod (POST)
* @ApiRoute (/api/exhibition/getExhibitionBanner)
* @ApiReturnParams (name="code", type="integer", required=true, sample="0")
* @ApiReturnParams (name="msg", type="string", required=true, sample="返回成功")
* @ApiReturnParams (name="data", type="object", description="扩展数据返回")
* @ApiReturn ({
"code": 1,
"msg": "查询成功",
"time": "1609756367",
"data": [
{
"id": 1,
"image": "图片路径",
"key_id": "外键id 展览id 为空不跳转",
"weigh": "排序",
"createtime": "1970-01-01 08:00:00",
"updatetime": "1970-01-01 08:00:00"
}
]
})
*/
public function getExhibitionBanner(){
//1.查询展览时长
$list = model('exhibition_banner')->order('weigh','desc')->select();
//2.返回
$this->success('查询成功',$list);
}
/**
* 查询展览详情
* @ApiTitle (查询展览详情)
* @ApiMethod (POST)
* @ApiRoute (/api/exhibition/getExhibitionContent)
* @ApiParams (name="id", type="integer", required=true, description="展览标ID")
* @ApiReturnParams (name="code", type="integer", required=true, sample="0")
* @ApiReturnParams (name="msg", type="string", required=true, sample="返回成功")
* @ApiReturnParams (name="data", type="object", description="扩展数据返回")
* @ApiReturn ({
"code": 1,
"msg": "查询成功",
"time": "1609757334",
"data": {
"id": 1,
"user_id": "用户ID",
"avatar": "头像",
"nickname": "署名",
"number": "展览编号",
"title": "展览标题",
"describe": "展览描述",
"exhibition_price_id": "价格ID",
"price": "价格",
"images": "展览图片",
"show_num": "查看数量",
"zan_num": "点赞数量",
"ping_num": "评价数量",
"price_num": "总价格",
"xiang_num": "星星数量",
"images_num": "图片数量",
"status": "状态:0=未支付,2=已支付,3=已下架",
"start_time": "开始时间",
"end_time": "结束时间",
"is_zan":"判断是否点赞",
"createtime": "2021-01-04 18:04:25",
"updatetime": "2021-01-04 18:04:25",
"deletetime": null,
"message": null
}
})
*/
public function getExhibitionContent(){
//1.查询id
$id = $this->get_data('id','展览ID不能为空');
//2.查询展览
$exhibition = model('exhibition')->where('status',1)->order('id',$id)->find();
if (!$exhibition){
$this->error('展览不存在或未支付');
}
//3.判断点赞
$exhibition['is_zan'] = 0;
$exhibition_zan = model('exhibition_zan')
->where('user_id',$this->auth->id)
->where('exhibition_id',$exhibition['id'])
->find();
if($exhibition_zan){
$exhibition['is_zan'] = 1;
}
//3.返回
$this->success('查询成功',$exhibition);
}
/**
* 查询展览列表
* @ApiTitle (查询展览列表)
* @ApiMethod (POST)
* @ApiRoute (/api/exhibition/getExhibitionList)
* @ApiParams (name="page", type="integer", required=true, description="分页次数")
* @ApiParams (name="num", type="integer", required=true, description="分页数量")
* @ApiParams (name="status", type="integer", required=true, description="0=全部展览,1=最新展览,2=最热展览")
* @ApiReturnParams (name="code", type="integer", required=true, sample="0")
* @ApiReturnParams (name="msg", type="string", required=true, sample="返回成功")
* @ApiReturnParams (name="data", type="object", description="扩展数据返回")
* @ApiReturn ()
*/
public function getExhibitionList(){
//1.查询数据
$data = $this->get_data_array([
['page','分页次数不能为空'],
['num','分页数量不能为空'],
['status','状态不能为空'],
]);
//2.查询数组
$exhibition = model('exhibition')
->field('id,images,title,show_num')
->where('status',1);
//全部展览
if ($data['status'] == 0){
$exhibition = $exhibition->order('createtime','desc');
}
//最新展览
if ($data['status'] == 1){
$exhibition = $exhibition->order('createtime','desc')->page($data['page'],$data['num']);
}
//最热展览
if ($data['status'] == 2){
$exhibition = $exhibition->order('zan_num','desc')->page($data['page'],$data['num']);
}
$exhibition = $exhibition->select();
//3.返回
$this->success('查询成功',$exhibition);
}
/**
* 点赞或取消点赞
* @ApiTitle (点赞或取消点赞)
* @ApiMethod (POST)
* @ApiRoute (/api/exhibition/setExhibitionZan)
* @ApiParams (name="exhibition_id", type="integer", required=true, description="展览ID")
* @ApiReturnParams (name="code", type="integer", required=true, sample="0")
* @ApiReturnParams (name="msg", type="string", required=true, sample="返回成功")
* @ApiReturnParams (name="data", type="object", description="扩展数据返回")
* @ApiReturn ({
"code": 1,
"msg": "查询成功",
"time": "1608886856",
"data": {
"code": "0取消点赞 1=点赞成功",
"msg": "提示"
}
})
*/
public function setExhibitionZan(){
//1.获取数据
$exhibition_id = $this->get_data('exhibition_id','展览id不能为空');
//2.查询点赞
$exhibition_zan = model('exhibition_zan')
->where('user_id',$this->auth->id)
->where('exhibition_id',$exhibition_id)
->find();
if ($exhibition_zan){
$exhibition_zan->delete();
model('exhibition')->where('id',$exhibition_zan)->setDec('zan_num');
$this->success('查询成功',['code'=>0,'msg'=>'取消点赞成功']);
}
//4.增加点赞
model('exhibition_zan')->create(['user_id'=>$this->auth->id,'exhibition_id'=>$exhibition_id]);
//5.增加点赞数量
model('exhibition')->where('id',$exhibition_id)->setInc('zan_num');
//6.返回结果
$this->success('查询成功',['code'=>1,'msg'=>'点赞成功']);
}
/**
* 获取展览评论列表
* @ApiTitle (获取展览评论列表)
* @ApiMethod (POST)
* @ApiRoute (/api/exhibition/getComment)
* @ApiParams (name="exhibition_id", type="integer", required=true, description="展览id")
* @ApiParams (name="page", type="integer", required=true, description="分页次数")
* @ApiParams (name="num", type="integer", required=true, description="分页数量")
* @ApiReturnParams (name="code", type="integer", required=true, sample="0")
* @ApiReturnParams (name="msg", type="string", required=true, sample="返回成功")
* @ApiReturnParams (name="data", type="object", description="扩展数据返回")
* @ApiReturn ({
"code": 1,
"msg": "查询成功",
"time": "1608890670",
"data": [
{
"id": 2,
"exhibition_id": "展览id",
"user_id": "用户id",
"content": "评论内容",
"pid": "0一级评论 不是0是父级评论id",
"zan_num": "点赞数量",
"createtime": "2020-12-25 17:53:07",
"updatetime": "2020-12-25 17:53:07",
"deletetime": null,
"message": null,
"is_zan": "是否点赞 0未点赞 1点赞",
"son_num":"子评论数量",
"user": "用户信息参考首页列表注释",
"str_time": "发布时间"
}
]
})
*/
public function getComment(){
Db::startTrans();
try {
//1.获取展览id
$data = $this->get_data_array([
['exhibition_id','展览id不能为空'],
['page','分页次数不能为空'],
['num','分页数量不能为空']
]);
//2.获取一级评论
$exhibition_comment = model('exhibition_comment')
->with(['user'])
->where('exhibition_id',$data['exhibition_id'])
->where('pid',0)
->order('createtime','desc')
->order('deletetime',null)
->page($data['page'],$data['num'])
->select();
//3.循环父级评论
foreach ($exhibition_comment as $key => $val){
//3.1 判断用户有没有点赞
$is_zan = model('exhibition_comment_zan')
->where('user_id',$this->auth->id)
->where('exhibition_comment_id',$val['id'])
->find();
$exhibition_comment[$key]['is_zan'] = 1;
if (!$is_zan){
$exhibition_comment[$key]['is_zan'] = 0;
}
//3.2 获取子评论数量
$exhibition_comment[$key]['son_num'] = model('exhibition_comment')
->where('pid',$val['id'])
->count();
}
Db::commit();
} catch (Exception $e) {
Db::rollback();
$this->error($e->getMessage());
}
//4.返回数据
$this->success('查询成功',$exhibition_comment);
}
/**
* 发布评论
* @ApiTitle (发布评论)
* @ApiMethod (POST)
* @ApiRoute (/api/exhibition/setComment)
* @ApiParams (name="exhibition_id", type="integer", required=true, description="展览id")
* @ApiParams (name="content", type="integer", required=true, description="评论内容")
* @ApiParams (name="pid", type="integer", required=true, description="父级评论id")
* @ApiReturnParams (name="code", type="integer", required=true, sample="0")
* @ApiReturnParams (name="msg", type="string", required=true, sample="返回成功")
* @ApiReturnParams (name="data", type="object", description="扩展数据返回")
* @ApiReturn ( )
*/
public function setComment(){
Db::startTrans();
try {
//1.获取展览id
$data= $this->get_data_array([
['exhibition_id','展览id不能为空'],
['content','评论内容'],
]);
//2.发布评论
$pid = empty(input('param.pid'))?0:input('param.pid');
$data['pid'] = $pid;
$data['user_id'] = $this->auth->id;
$data['zan_num'] = 0;
$res = model('exhibition_comment')->create($data);
$res = model('exhibition_comment')->with(['user'])->where('id',$res['id'])->find();
$res['is_zan'] = 0;
//3.增加展览评论数据
model('exhibition')->where('id',$data['exhibition_id'])->setInc('ping_num');
Db::commit();
} catch (Exception $e) {
Db::rollback();
$this->error($e->getMessage());
}
//3.发布成功
$this->success('发布评论成功',$res);
}
/**
* 根据父级评论获取子评论
* @ApiTitle (根据父级评论获取子评论)
* @ApiMethod (POST)
* @ApiRoute (/api/exhibition/getTwoComment)
* @ApiParams (name="exhibition_comment_id", type="integer", required=true, description="展览评论id")
* @ApiParams (name="page", type="integer", required=true, description="分页次数")
* @ApiParams (name="num", type="integer", required=true, description="分页数量")
* @ApiReturnParams (name="code", type="integer", required=true, sample="0")
* @ApiReturnParams (name="msg", type="string", required=true, sample="返回成功")
* @ApiReturnParams (name="data", type="object", description="扩展数据返回")
* @ApiReturn ({
"code": 1,
"msg": "获取评论成功",
"time": "1608892708",
"data": [
{
"id": 2,
"exhibition_id": "展览ID",
"user_id": "用户ID",
"content": "评论内容",
"pid": "父级id 注意:第一次返回的第一个数据是父级数据 第二次不会返回",
"zan_num": "点赞数量",
"createtime": "2020-12-25 17:53:07",
"updatetime": "2020-12-25 17:53:07",
"deletetime": null,
"message": null,
"is_zan": "是否点赞",
"is_this": "是不是自己发布的评论 1=是,0=不是",
"user": "用户信息 参考首页列表注释",
"str_time": "时间"
}
]
})
*/
public function getTwoComment(){
Db::startTrans();
try {
//1.获取展览id
$data= $this->get_data_array([
['exhibition_comment_id','展览评论id不能为空'],
['page','分页次数不能为空'],
['num','分页数量不能为空']
]);
//2.发布评论
$father_exhibition_comment = model('exhibition_comment')
->with(['user'])
->where('id',$data['exhibition_comment_id'])
->find();
if (!$father_exhibition_comment){
$this->error('您的父级评论不存在');
}
//3.判断是不是第一次 如果是第一次添加进去父级评论
$array = [];
if ($data['page'] == 1){
$array[] = $father_exhibition_comment;
}
//4.查询子级数据
$son_exhibition_somment_array = model('exhibition_comment')
->with(['user'])
->where('pid',$father_exhibition_comment['id'])
->order('createtime','desc')
->page($data['page'],$data['num'])
->select();
foreach ($son_exhibition_somment_array as $val){
$array[] = $val;
}
//5.循环查询是否点赞
foreach ($array as $key => $val){
//3.1 判断用户有没有点赞
$is_zan = model('exhibition_comment_zan')
->where('user_id',$this->auth->id)
->where('exhibition_comment_id',$val['id'])
->find();
$array[$key]['is_zan'] = 1;
if (!$is_zan){
$array[$key]['is_zan'] = 0;
}
//3.2判断是不是自己发布的评论
$array[$key]['is_this'] = 0;
if ($val['user_id'] == $this->auth->id){
$array[$key]['is_this'] = 1;
}
}
Db::commit();
} catch (Exception $e) {
Db::rollback();
$this->error($e->getMessage());
}
$this->success('获取评论成功',$array);
}
/**
* 展览评论点赞或取消点赞{注意}
* @ApiTitle (展览评论点赞或取消点赞{注意})
* @ApiMethod (POST)
* @ApiRoute (/api/exhibition/setExhibitionCommentZan)
* @ApiParams (name="exhibition_comment_id", type="integer", required=true, description="展览内容")
* @ApiReturnParams (name="code", type="integer", required=true, sample="0")
* @ApiReturnParams (name="msg", type="string", required=true, sample="返回成功")
* @ApiReturnParams (name="data", type="object", description="扩展数据返回")
* @ApiReturn ({
"code": 1,
"msg": "查询成功",
"time": "1608886856",
"data": {
"code": "0取消点赞 1=点赞成功",
"msg": "提示"
}
})
*/
public function setExhibitionCommentZan(){
//1.获取数据
$exhibition_comment_id = $this->get_data('exhibition_comment_id','展览评论id不能为空');
//2.查询展览数据
$exhibition_comment = model('exhibition_comment')->where('id',$exhibition_comment_id)->find();
//3.查询点赞
$exhibition_comment_zan = model('exhibition_comment_zan')
->where('user_id',$this->auth->id)
->where('exhibition_comment_id',$exhibition_comment_id)
->find();
if ($exhibition_comment_zan){
$exhibition_comment_zan->delete();
$exhibition_comment->zan_num -= 1;
$exhibition_comment->save();
$this->success('查询成功',['code'=>0,'msg'=>'取消点赞成功']);
}
//4.增加点赞
model('exhibition_comment_zan')->create(['user_id'=>$this->auth->id,'exhibition_comment_id'=>$exhibition_comment_id]);
//5.增加点赞数量
$exhibition_comment->zan_num += 1;
$exhibition_comment->save();
//6.返回结果
$this->success('查询成功',['code'=>1,'msg'=>'点赞成功']);
}
/**
* 举报展览
* @ApiTitle (举报展览)
* @ApiMethod (POST)
* @ApiRoute (/api/exhibition/setExhibitionReport)
* @ApiParams (name="exhibition_id", type="integer", required=true, description="展览id")
* @ApiParams (name="report_type_id", type="integer", required=true, description="举报类型ID")
* @ApiParams (name="content", type="integer", required=true, description="举报内容")
* @ApiReturnParams (name="code", type="integer", required=true, sample="0")
* @ApiReturnParams (name="msg", type="string", required=true, sample="返回成功")
* @ApiReturnParams (name="data", type="object", description="扩展数据返回")
* @ApiReturn ({
"code": 1,
"msg": "举报成功",
"time": "1609760150",
"data": {
"exhibition_id": "1",
"report_type_id": "1",
"content": "你说的啥啊",
"user_id": 2,
"avatar": "https://thirdwx.qlogo.cn/mmopen/vi_32/DYAIOgq83eo0mGhWdZVZMqyNCg4CWn7Xyplya5eEF1UUnFlOcF4vvZ9IibfWGocjiatViaP9b4JtosbuP9NibhlEWw/132",
"nickname": "珍惜自己的名字",
"username": "u2",
"mobile": "",
"status": 0,
"report_type_name": "违法违禁",
"createtime": "2021-01-04 19:35:51",
"updatetime": "2021-01-04 19:35:51",
"id": "8"
}
})
*/
public function setExhibitionReport(){
Db::startTrans();
try {
//1.获取展览id
$data= $this->get_data_array([
['exhibition_id','展览ID不能为空'],
['report_type_id','举报类型ID不能为空'],
['content','举报内容不能为空'],
]);
//2.查询举报内容
$exhibition_report = model('exhibition_report')
->where('user_id',$this->auth->id)
->where('exhibition_id',$data['exhibition_id'])
->where('report_type_id',$data['report_type_id'])
->where('status',0)
->find();
if ($exhibition_report){
$this->error('您已经举报该展览,请等待管理员审核!');
}
//3.查询举报类型
$data['user_id'] = $this->auth->id;
$data['avatar'] = $this->auth->avatar;
$data['nickname'] = $this->auth->nickname;
$data['username'] = $this->auth->username;
$data['mobile'] = $this->auth->mobile;
$data['status'] = 0;
$data['report_type_name'] = model('report_type')->where('id',$data['report_type_id'])->find()['name']??'';
$res = model('exhibition_report')->create($data);
Db::commit();
} catch (Exception $e) {
Db::rollback();
$this->error($e->getMessage());
}
//3.发布成功
$this->success('举报成功',$res);
}
/**
* 举报评论
* @ApiTitle (举报评论)
* @ApiMethod (POST)
* @ApiRoute (/api/exhibition/setExhibitionCommentReport)
* @ApiParams (name="exhibition_comment_id", type="integer", required=true, description="评论id")
* @ApiParams (name="report_type_id", type="integer", required=true, description="举报类型ID")
* @ApiParams (name="content", type="integer", required=true, description="举报内容")
* @ApiReturnParams (name="code", type="integer", required=true, sample="0")
* @ApiReturnParams (name="msg", type="string", required=true, sample="返回成功")
* @ApiReturnParams (name="data", type="object", description="扩展数据返回")
* @ApiReturn ()
*/
public function setExhibitionCommentReport(){
try {
//1.获取展览id
$data= $this->get_data_array([
['exhibition_comment_id','评论ID不能为空'],
['report_type_id','举报类型ID不能为空'],
['content','举报内容不能为空'],
]);
//2.查询举报内容
$exhibition_report = model('exhibition_comment_report')
->where('user_id',$this->auth->id)
->where('exhibition_comment_id',$data['exhibition_comment_id'])
->where('report_type_id',$data['report_type_id'])
->where('status',0)
->find();
if ($exhibition_report){
$this->error('您已经举报该评论,请等待管理员审核!');
}
//3.查询举报类型
$data['user_id'] = $this->auth->id;
$data['avatar'] = $this->auth->avatar;
$data['nickname'] = $this->auth->nickname;
$data['username'] = $this->auth->username;
$data['mobile'] = $this->auth->mobile;
$data['status'] = 0;
$data['report_type_name'] = model('report_type')->where('id',$data['report_type_id'])->find()['name']??'';
$res = model('exhibition_comment_report')->create($data);
Db::commit();
} catch (Exception $e) {
Db::rollback();
$this->error($e->getMessage());
}
//3.发布成功
$this->success('举报成功',$res);
}
}
\ No newline at end of file
... ...
<?php
namespace app\common\model;
class Exhibition extends BaseModel
{
}
\ No newline at end of file
... ...
<?php
namespace app\common\model;
class ExhibitionBanner extends BaseModel
{
}
\ No newline at end of file
... ...
<?php
namespace app\common\model;
class ExhibitionComment extends BaseModel
{
/**
* 关联用户表
*/
public function User(){
return $this->belongsTo('user','user_id','id')->field('id,avatar,nickname,username,authlist');
}
}
\ No newline at end of file
... ...
<?php
namespace app\common\model;
class ExhibitionCommentReport extends BaseModel
{
}
\ No newline at end of file
... ...
<?php
namespace app\common\model;
class ExhibitionCommentZan extends BaseModel
{
}
\ No newline at end of file
... ...
<?php
namespace app\common\model;
class ExhibitionPrice extends BaseModel
{
}
\ No newline at end of file
... ...
<?php
namespace app\common\model;
class ExhibitionReport extends BaseModel
{
}
\ No newline at end of file
... ...
<?php
namespace app\common\model;
class ExhibitionZan extends BaseModel
{
}
\ No newline at end of file
... ...
此 diff 太大无法显示。