39 lines
688 B
PHP
39 lines
688 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace app\api\controller;
|
||
|
|
|
||
|
|
use think\Controller;
|
||
|
|
use think\Db;
|
||
|
|
use think\Log;
|
||
|
|
|
||
|
|
use app\common\controller\BaseCom;
|
||
|
|
|
||
|
|
class Xintiao extends BaseCom
|
||
|
|
{
|
||
|
|
|
||
|
|
|
||
|
|
public function keep_xintiao()
|
||
|
|
{
|
||
|
|
$user_id = $this->uid;
|
||
|
|
$is_xintiao = db::name('vs_xintiao')->where('user_id' , $user_id)->find();
|
||
|
|
if($is_xintiao){
|
||
|
|
db::name('vs_xintiao')->where('user_id' , $user_id)->update(['updatetime' => time()]);
|
||
|
|
}else{
|
||
|
|
db::name('vs_xintiao')->insert([
|
||
|
|
'user_id' => $user_id,
|
||
|
|
'createtime' => time(),
|
||
|
|
'updatetime' => time()
|
||
|
|
]);
|
||
|
|
}
|
||
|
|
return true;
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
}
|