作者 王智

xiugai

... ... @@ -10,6 +10,7 @@ namespace app\api\controller;
use app\common\controller\Api;
use http\Params;
use think\Db;
/**
... ... @@ -145,4 +146,41 @@ class Content extends Api
$Arr = Db::name('huodong_content')->where('id', 1)->find();
$this->success('成功', $Arr);
}
/**
* 富文本接口
* @ApiTitle (封面海报)
* @ApiSummary (封面海报)
* @ApiMethod (POST)
* @ApiRoute (/api/Content/WaterPaper)
* @ApiHeaders (name=token, type=string, required=true, description="请求的Token")
* @ApiReturnParams (name="code", type="integer", required=true, sample="0")
* @ApiReturnParams (name="msg", type="string", required=true, sample="返回成功")
* @ApiReturn ({
'code':'1',
'msg':'返回成功',
"data": {
}
})
*/
public function WaterPaper()
{
$UserId = $this->is_token($this->request->header());
$start_time = mktime(0, 0, 0, date('m'), date('d'), date('Y'));
$end_time = mktime(0, 0, 0, date('m'), date('d') + 1, date('Y')) - 1;
$map['createtime'] = ['between', [$start_time, $end_time]];
$InInfo = Db::name('index_water')->where($map)->where('user_id', $UserId)->find();
if (empty($InInfo)) {
$Image = Db::name('water_paper')->where('id', 1)->find();
$data = [
'user_id' => $UserId,
'createtime' => time()
];
Db::name('index_water')->insert($data);
} else {
$Image = '';
}
$this->success('成功', $Image);
}
}
\ No newline at end of file
... ...