This commit is contained in:
mkm 2024-01-11 15:41:17 +08:00
parent 0e0a80fc7c
commit 10ddd7869a

View File

@ -566,9 +566,13 @@ class Project extends BasicApi
public function positioning(){
$member_code=Request::post('member_code');
$positioning=Request::post('positioning');
// $find=Db::name('positioning')->where(['member_code'=>$member_code,'positioning'=>$positioning])->find();
if($member_code && $positioning){
Db::name('positioning')->insert(['member_code'=>$member_code,'positioning'=>$positioning,'date'=>date('Y-m-d H:i:s')]);
$find=Db::name('positioning')->where(['member_code'=>$member_code,'positioning'=>$positioning])->find();
if($find){
Db::name('positioning')->where(['member_code'=>$member_code,'positioning'=>$positioning])->update(['end_date'=>date('Y-m-d H:i:s')]);
}else{
if($member_code && $positioning){
Db::name('positioning')->insert(['member_code'=>$member_code,'positioning'=>$positioning,'date'=>date('Y-m-d H:i:s')]);
}
}
$this->success('');
}