1
This commit is contained in:
@@ -598,10 +598,12 @@ class Board extends Controller {
|
||||
$cs['board_id'] = $data['jboard_id'];
|
||||
$cs['email'] = $data['email'];
|
||||
$list = myPost($url, $cs);
|
||||
$check = $this->board_to_journal_obj->where('user_id',$data['user_id'])->where('journal_id',$data['journal_id'])->where('state',0)->find();
|
||||
if(!$check){
|
||||
$insert['user_id'] = $data['user_id'];
|
||||
$insert['journal_id'] = $data['journal_id'];
|
||||
$this->board_to_journal_obj->insert($insert);
|
||||
|
||||
}
|
||||
return jsonSuccess([]);
|
||||
}
|
||||
|
||||
|
||||
@@ -448,25 +448,26 @@ class Chief extends Controller {
|
||||
* @param name:phone type:string require:0 desc:电话
|
||||
*/
|
||||
public function addJournalBoard(){
|
||||
$data = $this->request->post();
|
||||
$check = $this->user_obj->where('account',trim($data['account']))->where('email',trim($data['email']))->where('state',0)->find();
|
||||
if($check){
|
||||
return jsonError('Account or Email has been register!');
|
||||
}
|
||||
$insert['account'] = trim($data['account']);
|
||||
$insert['email'] = trim($data['email']);
|
||||
$insert['password'] = md5(trim($data['password']));
|
||||
$insert['realname'] = isset($data['realname'])?trim($data['realname']):'';
|
||||
$insert['phone'] = isset($data['phone'])?trim($data['phone']):'';
|
||||
$insert['type'] = 4;
|
||||
$insert['ctime'] = time();
|
||||
$uid = $this->user_obj->insertGetId($insert);
|
||||
//添加对应关系
|
||||
$to_insert['user_id'] = $uid;
|
||||
$to_insert['journal_id'] = $data['journal_id'];
|
||||
$this->board_to_journal_obj->insert($to_insert);
|
||||
return jsonError('Service Stop');
|
||||
// $data = $this->request->post();
|
||||
// $check = $this->user_obj->where('account',trim($data['account']))->where('email',trim($data['email']))->where('state',0)->find();
|
||||
// if($check){
|
||||
// return jsonError('Account or Email has been register!');
|
||||
// }
|
||||
// $insert['account'] = trim($data['account']);
|
||||
// $insert['email'] = trim($data['email']);
|
||||
// $insert['password'] = md5(trim($data['password']));
|
||||
// $insert['realname'] = isset($data['realname'])?trim($data['realname']):'';
|
||||
// $insert['phone'] = isset($data['phone'])?trim($data['phone']):'';
|
||||
// $insert['type'] = 4;
|
||||
// $insert['ctime'] = time();
|
||||
// $uid = $this->user_obj->insertGetId($insert);
|
||||
// //添加对应关系
|
||||
// $to_insert['user_id'] = $uid;
|
||||
// $to_insert['journal_id'] = $data['journal_id'];
|
||||
// $this->board_to_journal_obj->insert($to_insert);
|
||||
|
||||
return jsonSuccess([]);
|
||||
// return jsonSuccess([]);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -480,15 +481,18 @@ class Chief extends Controller {
|
||||
* @param name:journal_id type:int require:1 desc:期刊id
|
||||
*/
|
||||
public function addJournalBoardHas(){
|
||||
$data = $this->request->post();
|
||||
$check = $this->board_to_journal_obj->where('user_id',$data['user_id'])->where('journal_id',$data['journal_id'])->where('state',0)->find();
|
||||
if($check!=null){
|
||||
return jsonError('has register!');
|
||||
}
|
||||
$insert['journal_id'] = $data['journal_id'];
|
||||
$insert['user_id'] = $data['user_id'];
|
||||
$this->board_to_journal_obj->insert($insert);
|
||||
return jsonSuccess([]);
|
||||
return jsonError('Service Stop');
|
||||
|
||||
|
||||
// $data = $this->request->post();
|
||||
// $check = $this->board_to_journal_obj->where('user_id',$data['user_id'])->where('journal_id',$data['journal_id'])->where('state',0)->find();
|
||||
// if($check!=null){
|
||||
// return jsonError('has register!');
|
||||
// }
|
||||
// $insert['journal_id'] = $data['journal_id'];
|
||||
// $insert['user_id'] = $data['user_id'];
|
||||
// $this->board_to_journal_obj->insert($insert);
|
||||
// return jsonSuccess([]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user