FIX: Find where in add
This commit is contained in:
@ -132,7 +132,11 @@ abstract class Model extends BaseModel implements ModelInterface {
|
|||||||
if (method_exists($class, 'find')) {
|
if (method_exists($class, 'find')) {
|
||||||
$obj = self::find($factory, $input);
|
$obj = self::find($factory, $input);
|
||||||
} else {
|
} else {
|
||||||
$obj = $factory->find($class)->where($data)->one();
|
$where = $data;
|
||||||
|
$where = array_values(array_walk($where, function(&$item, $key) {
|
||||||
|
$item = [$key, $item];
|
||||||
|
}));
|
||||||
|
$obj = $factory->find($class)->where($where)->one();
|
||||||
}
|
}
|
||||||
if ($obj === false) {
|
if ($obj === false) {
|
||||||
$obj = $factory->create($class, $data);
|
$obj = $factory->create($class, $data);
|
||||||
|
Reference in New Issue
Block a user