|
@@ -56,7 +56,7 @@ class NoticeService extends BaseService
|
|
|
*/
|
|
*/
|
|
|
public function getDataList($num = 30, $type=2)
|
|
public function getDataList($num = 30, $type=2)
|
|
|
{
|
|
{
|
|
|
- $cacheKey = "caches:index:notices_{$type}";
|
|
|
|
|
|
|
+ $cacheKey = "caches:notices:index_{$type}";
|
|
|
$datas = RedisService::get($cacheKey);
|
|
$datas = RedisService::get($cacheKey);
|
|
|
if($datas){
|
|
if($datas){
|
|
|
return $datas;
|
|
return $datas;
|
|
@@ -82,7 +82,7 @@ class NoticeService extends BaseService
|
|
|
*/
|
|
*/
|
|
|
public function updateOrderNotice($title, $content, $type = 2)
|
|
public function updateOrderNotice($title, $content, $type = 2)
|
|
|
{
|
|
{
|
|
|
- RedisService::clear("caches:index:notices_{$type}");
|
|
|
|
|
|
|
+ RedisService::clear("caches:notices:index_{$type}");
|
|
|
$this->model->where(['type'=>2])->where('create_time','<=', time() - 7 * 86400)->delete();
|
|
$this->model->where(['type'=>2])->where('create_time','<=', time() - 7 * 86400)->delete();
|
|
|
return $this->model->insertGetId(['title'=>$title,'content'=>$content,'type'=>2,'status'=>1,'create_time'=>time()]);
|
|
return $this->model->insertGetId(['title'=>$title,'content'=>$content,'type'=>2,'status'=>1,'create_time'=>time()]);
|
|
|
}
|
|
}
|