final_plat_id ?: 0; } public function getPlatLog($uid = 0) { if ($uid = $uid ?: \YunShop::app()->getMemberId()) { $model = self::where('uid', $uid)->first(); if ($model && $model->final_plat_id) { $res = BusinessService::checkBusinessRight($model->final_plat_id, $uid); if (!$res['identity']) { $model->final_plat_id = 0; $model->save(); } } if (!$model) { $model = self::create([ 'uniacid' => \YunShop::app()->uniacid, 'uid' => $uid, 'final_plat_id' => 0 ]); } } else { $model = (Object)[]; } return $model; } }