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

View File

@ -566,10 +566,14 @@ class Project extends BasicApi
public function positioning(){ public function positioning(){
$member_code=Request::post('member_code'); $member_code=Request::post('member_code');
$positioning=Request::post('positioning'); $positioning=Request::post('positioning');
// $find=Db::name('positioning')->where(['member_code'=>$member_code,'positioning'=>$positioning])->find(); $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){ if($member_code && $positioning){
Db::name('positioning')->insert(['member_code'=>$member_code,'positioning'=>$positioning,'date'=>date('Y-m-d H:i:s')]); Db::name('positioning')->insert(['member_code'=>$member_code,'positioning'=>$positioning,'date'=>date('Y-m-d H:i:s')]);
} }
}
$this->success(''); $this->success('');
} }