You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

20 lines
696 B

<?php
require_once './wf_common.php';
$request = $_SERVER['REQUEST_METHOD'] == "GET" ? $_GET : $_POST;
//echo json_encode($request);
$func = $request['method'];
if (function_exists($func)) {
call_user_func($func, $request);
}
function add_brand($req)
{
$new_brand = $req['new_brand'];
list($code_name) = DB::fields("select cast(count(code_name) as SIGNED) +1 from code where field_name='elevator_brand' and code_name!='Z' ");
DB::query("INSERT INTO `code` (`field_name`, `code_name`, `content`, `remark`, `creator`, `create_at`) VALUES
('elevator_brand', '$code_name', '$new_brand', '电梯品牌', '', now());
");
echo json_encode(['seq' => $code_name]);
}