mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2025-04-06 03:58:04 +08:00
[更新]基础代码整理
This commit is contained in:
parent
31777376d8
commit
bbab04b2bc
@ -59,9 +59,9 @@ class BasicAdmin extends Controller {
|
|||||||
* @param array $data 扩展数据
|
* @param array $data 扩展数据
|
||||||
* @return array|string
|
* @return array|string
|
||||||
*/
|
*/
|
||||||
protected function _form($dbQuery = null, $tplFile = '', $pkField = null, $where = [], $data = []) {
|
protected function _form($dbQuery = null, $tplFile = '', $pkField = '', $where = [], $data = []) {
|
||||||
$db = is_null($dbQuery) ? Db::name($this->table) : (is_string($dbQuery) ? Db::name($dbQuery) : $dbQuery);
|
$db = is_null($dbQuery) ? Db::name($this->table) : (is_string($dbQuery) ? Db::name($dbQuery) : $dbQuery);
|
||||||
$pk = is_null($pkField) ? ($db->getPk() ? $db->getPk() : 'id') : $pkField;
|
$pk = empty($pkField) ? ($db->getPk() ? $db->getPk() : 'id') : $pkField;
|
||||||
$pkValue = $this->request->request($pk, isset($where[$pk]) ? $where[$pk] : (isset($data[$pk]) ? $data[$pk] : null));
|
$pkValue = $this->request->request($pk, isset($where[$pk]) ? $where[$pk] : (isset($data[$pk]) ? $data[$pk] : null));
|
||||||
// POST请求, 数据自动存库
|
// POST请求, 数据自动存库
|
||||||
if ($this->request->isPost()) {
|
if ($this->request->isPost()) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user