no message
This commit is contained in:
parent
8148e84373
commit
b22fa7e662
@ -62,6 +62,47 @@ final class User extends Base
|
||||
|
||||
}
|
||||
|
||||
private function ValueTypeFormat($sValue)
|
||||
{
|
||||
list($sValue, $sValueType) = explode("#", $sValue);
|
||||
|
||||
if ($sValueType) {
|
||||
if ($sValueType == "gb") {
|
||||
$sValue = Tools::tomGbToB($sValue);
|
||||
} else if ($sValueType == "date") {
|
||||
$sValue = strtotime($sValue);
|
||||
}
|
||||
}
|
||||
|
||||
return $sValue;
|
||||
}
|
||||
|
||||
public function Set($aParam)
|
||||
{
|
||||
|
||||
// $iId = 1778;
|
||||
$iId = $aParam['aOption'][1];
|
||||
$sField = $aParam['aOption'][2];
|
||||
$sValue = $aParam['aArg'][1];
|
||||
$sValue = $this->ValueTypeFormat($sValue);
|
||||
|
||||
if (!$iId) {
|
||||
return "没有id";
|
||||
}
|
||||
|
||||
$oUser = ModelUser::find($iId);
|
||||
|
||||
if ($oUser) {
|
||||
$oUser->$sField = $sValue;
|
||||
$r = $oUser->save();
|
||||
} else {
|
||||
$r = '没有';
|
||||
}
|
||||
|
||||
return $r;
|
||||
|
||||
}
|
||||
|
||||
public function Find($aParam)
|
||||
{
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user