no message
This commit is contained in:
parent
fdf9d82de8
commit
1bcd692499
@ -356,18 +356,20 @@ class Dog extends Mod\Base {
|
||||
|
||||
public function clone($aParam)
|
||||
{
|
||||
$iId = $aParam['aArg'][1] ?? false;
|
||||
$sValue = $aParam['aArg'][1] ?? false;
|
||||
$sWhereField = $aParam["aOption"][1] ?? $this->sPrimaryKey;
|
||||
|
||||
if ($iId == "?") {
|
||||
return "#clone {主键值}";
|
||||
if ($sValue == "?") {
|
||||
return "#clone__{whereField?primary} {whereValue}";
|
||||
}
|
||||
|
||||
if (!$iId) {
|
||||
return "需要arg[1]";
|
||||
if (!$sValue) {
|
||||
return "需要value";
|
||||
}
|
||||
|
||||
// 查找文章
|
||||
$oModelSelf = $this->oModelSelf->find($iId);
|
||||
// $oModelSelf = $this->oModelSelf->find($iId);
|
||||
$oModelSelf = $this->oModelSelf->where($this->sPrimaryKey, $sValue)->first();
|
||||
|
||||
if (!$oModelSelf) {
|
||||
return "没找到这个";
|
||||
@ -377,7 +379,7 @@ class Dog extends Mod\Base {
|
||||
$oModelSelfNew->save();
|
||||
|
||||
$aParam = [];
|
||||
$aParam["aArg"][1] = $oModelSelfNew->{$this->sPrimaryKey};
|
||||
$aParam["aArg"][1] = $oModelSelfNew->$sWhereField;
|
||||
|
||||
return $this->find($aParam);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user