作者 曹东东

1

... ... @@ -96,7 +96,7 @@ class Newscategory extends ManystoreBase
} catch (PDOException $e) {
Db::rollback();
$this->error($e->getMessage());
} catch (Exception $e) {
} catch (\Exception $e) {
Db::rollback();
$this->error($e->getMessage());
}
... ... @@ -148,7 +148,7 @@ class Newscategory extends ManystoreBase
} catch (PDOException $e) {
Db::rollback();
$this->error($e->getMessage());
} catch (Exception $e) {
} catch (\Exception $e) {
Db::rollback();
$this->error($e->getMessage());
}
... ... @@ -192,7 +192,7 @@ class Newscategory extends ManystoreBase
} catch (PDOException $e) {
Db::rollback();
$this->error($e->getMessage());
} catch (Exception $e) {
} catch (\Exception $e) {
Db::rollback();
$this->error($e->getMessage());
}
... ...
... ... @@ -32,14 +32,14 @@ class Newscategory extends Model
'p_name'
];
protected static function init()
{
self::afterInsert(function ($row) {
$pk = $row->getPk();
$row->getQuery()->where($pk, $row[$pk])->update(['weigh' => $row[$pk]]);
});
}
//
// protected static function init()
// {
// self::afterInsert(function ($row) {
// $pk = $row->getPk();
// $row->getQuery()->where($pk, $row[$pk])->update(['weigh' => $row[$pk]]);
// });
// }
public function getComposeList()
... ...