20201112
This commit is contained in:
@@ -134,17 +134,26 @@ class Journal extends Controller {
|
||||
*/
|
||||
public function getJournalTopic() {
|
||||
$data = $this->request->post();
|
||||
$p_res = $this->journal_topic_obj
|
||||
->where('journal_id', $data['journal_id'])
|
||||
->where('state', 0)
|
||||
->where('parent_id',0)
|
||||
->order('sort')
|
||||
->select();
|
||||
|
||||
$res = $this->journal_topic_obj
|
||||
->where('journal_id', $data['journal_id'])
|
||||
->where('state', 0)
|
||||
->where('parent_id','>',0)
|
||||
->order('sort asc,journal_topic_id asc')
|
||||
->select();
|
||||
//处理数组
|
||||
$frag = [];
|
||||
foreach ($res as $v) {
|
||||
if ($v['parent_id'] == 0) {
|
||||
$frag[] = $v;
|
||||
}
|
||||
}
|
||||
$frag = $p_res;
|
||||
// foreach ($res as $v) {
|
||||
// if ($v['parent_id'] == 0) {
|
||||
// $frag[] = $v;
|
||||
// }
|
||||
// }
|
||||
foreach ($frag as $kk => $vv) {
|
||||
$frag[$kk] = $this->getChieldarr($vv, $res);
|
||||
}
|
||||
@@ -650,6 +659,7 @@ class Journal extends Controller {
|
||||
$repeat = $this->subscribe_journal_obj
|
||||
->where('journal_id', $data['journal_id'])
|
||||
->where('email', $data['email'])
|
||||
->where('state',0)
|
||||
->find();
|
||||
if ($repeat) {
|
||||
return jsonError('repeat subscribe!');
|
||||
@@ -691,6 +701,7 @@ class Journal extends Controller {
|
||||
$repeat = $this->subscribe_topic_obj
|
||||
->where('topic_id', $data['topic_id'])
|
||||
->where('email', $data['email'])
|
||||
->where('state',0)
|
||||
->find();
|
||||
if ($repeat) {
|
||||
return jsonError('repeat subscribe!');
|
||||
|
||||
Reference in New Issue
Block a user