1
This commit is contained in:
@@ -1082,31 +1082,6 @@ class Journal extends Controller {
|
|||||||
return jsonSuccess($re);
|
return jsonSuccess($re);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function tttt() {
|
|
||||||
$host = "localhost"; //mysql服务器地址
|
|
||||||
$user = 'root';
|
|
||||||
$pass = 'root';
|
|
||||||
$dbName = 'journal'; //数据可名称
|
|
||||||
$charSet = 'utf8';
|
|
||||||
$port = '3306';
|
|
||||||
$conn = mysql_connect($host, $user, $padd);
|
|
||||||
if (!$conn) {
|
|
||||||
echo 'unable to connect to DB ' . mysql_error();
|
|
||||||
exit();
|
|
||||||
}
|
|
||||||
query('use ' . $db);
|
|
||||||
|
|
||||||
|
|
||||||
$sql = "select * from j_user limit 1"; //这里是sql语句
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$res = getAll($sql);
|
|
||||||
|
|
||||||
echo '<pre>';
|
|
||||||
var_dump($res);
|
|
||||||
echo '</pre>';
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @title 添加期刊订阅
|
* @title 添加期刊订阅
|
||||||
|
|||||||
@@ -227,15 +227,26 @@ class Special extends Controller {
|
|||||||
*/
|
*/
|
||||||
public function addSpecialEditor(){
|
public function addSpecialEditor(){
|
||||||
$data = $this->request->post();
|
$data = $this->request->post();
|
||||||
|
// 验证规则
|
||||||
|
$rule = new Validate([
|
||||||
|
'journal_id'=>'require|number',
|
||||||
|
'email'=>'require',
|
||||||
|
'first_name'=>'require',
|
||||||
|
'last_name'=>'require',
|
||||||
|
'address'=>'require',
|
||||||
|
]);
|
||||||
|
if(!$rule->check($data)){
|
||||||
|
return jsonError($rule->getError());
|
||||||
|
}
|
||||||
$insert['journal_id'] = $data['journal_id'];
|
$insert['journal_id'] = $data['journal_id'];
|
||||||
$insert['email'] = trim($data['email']);
|
$insert['email'] = trim($data['email']);
|
||||||
$insert['first_name'] = trim($data['first_name']);
|
$insert['first_name'] = trim($data['first_name']);
|
||||||
$insert['last_name'] = trim($data['last_name']);
|
$insert['last_name'] = trim($data['last_name']);
|
||||||
$insert['address'] = trim($data['address']);
|
$insert['address'] = trim($data['address']);
|
||||||
$insert['interests'] = trim($data['interests']);
|
$insert['interests'] = isset($data['interests'])?trim($data['interests']):'';
|
||||||
$insert['website'] = trim($data['website']);
|
$insert['website'] = isset($data['website'])?trim($data['website']):'';
|
||||||
$insert['orcid'] = trim($data['orcid']);
|
$insert['orcid'] = isset($data['orcid'])?trim($data['orcid']):'';
|
||||||
$insert['icon'] = trim($data['specialIcon']);
|
$insert['icon'] = isset($data['specialIcon'])?trim($data['specialIcon']):'';
|
||||||
$this->journal_special_editor_obj->insert($insert);
|
$this->journal_special_editor_obj->insert($insert);
|
||||||
return jsonSuccess([]);
|
return jsonSuccess([]);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user