656 lines
25 KiB
PHP
656 lines
25 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\Admin;
|
|
|
|
use Illuminate\Http\Request;
|
|
use App\Http\Controllers\Controller;
|
|
use App\Models\Label;
|
|
use App\Models\LabelHistory;
|
|
use App\Models\QuestionType;
|
|
use App\Models\CommonProblem;
|
|
use App\Models\Questions;
|
|
use App\Models\Answers;
|
|
use App\Models\Options;
|
|
use App\Models\Activity;
|
|
use App\Models\Questionnaire;
|
|
|
|
class LabelController extends Controller
|
|
{
|
|
//创建印象标签
|
|
public function createLabel(Request $request){
|
|
try {
|
|
$label_names = $request->label_name;
|
|
if (empty($label_names)) return $this->failure('请输入至少一个标签名');
|
|
$sex = $request->input('sex');
|
|
if (empty($sex)) return $this->failure('请选择标签所属性别');
|
|
$sort = $request->input('sort',0);
|
|
$text_color = $request->input('text_color');
|
|
$bg_color = $request->input('bg_color');
|
|
$type = $request->input('type');
|
|
$desc = $request->input('desc');
|
|
$la = Label::where('sex',$sex)->whereIn('label',$label_names)->first();
|
|
if ($la) return $this->failure($la->label.'标签已存在,请修改!');
|
|
$data = [];
|
|
foreach ($label_names as $label_name) {
|
|
$data[] = [
|
|
'label'=> $label_name,
|
|
'sex' => $sex,
|
|
'sort' => $sort,
|
|
'text_color' => $text_color,
|
|
'type' => $type,
|
|
'desc' => $desc,
|
|
'operator' => auth()->id(),
|
|
'created_at' => date('Y-m-d H:i:s'),
|
|
'updated_at' => date('Y-m-d H:i:s'),
|
|
];
|
|
}
|
|
Label::insert($data);
|
|
return $this->success('ok');
|
|
} catch (\Exception $e) {
|
|
$this->getError($e);
|
|
return $this->failure('创建印象标签失败');
|
|
}
|
|
}
|
|
|
|
|
|
//标签列表
|
|
public function labels(Request $request){
|
|
try {
|
|
$keyword = $request->keyword;
|
|
$sex = $request->sex;
|
|
$labels = Label::with('operator')->orderBy('id','desc');
|
|
if ($sex) {
|
|
$labels = $labels->where('sex',$sex);
|
|
}
|
|
if($keyword){
|
|
$keyword = trim($keyword);
|
|
$labels = $labels->whereHas('operator',function($sql) use($keyword){
|
|
$sql->where('id','like','%'.$keyword.'%')->orWhere('nickname','like','%'.$keyword.'%')->orWhere('mobile','like','%'.$keyword.'%');
|
|
});
|
|
}
|
|
|
|
$labels = $labels->paginate();
|
|
return $this->success('ok',$labels);
|
|
} catch (\Exception $e) {
|
|
$this->getError($e);
|
|
return $this->failure('获取标签列表失败');
|
|
}
|
|
}
|
|
|
|
public function labelUpdate(Request $request,$label_id){
|
|
try {
|
|
$label = Label::find($label_id);
|
|
if (empty($label)) return $this->failure('该标签不存在');
|
|
$label_name = $request->input('label_name');
|
|
$sex = $request->input('sex');
|
|
$sort = $request->input('sort',0);
|
|
$text_color = $request->input('text_color');
|
|
$bg_color = $request->input('bg_color');
|
|
$type = $request->input('type');
|
|
$desc = $request->input('desc');
|
|
|
|
$label->label = $label_name;
|
|
$label->type = $type;
|
|
$label->sex = $sex;
|
|
$label->sort = $sort;
|
|
$label->text_color = $text_color;
|
|
$label->bg_color = $bg_color;
|
|
$label->desc = $desc;
|
|
$label->operator = auth()->id();
|
|
$label->save();
|
|
return $this->success('ok');
|
|
} catch (\Exception $e) {
|
|
$this->getError($e);
|
|
return $this->failure('修改印象标签失败');
|
|
}
|
|
}
|
|
|
|
public function deleteLabel(Request $request,$label_id){
|
|
try {
|
|
$label = Label::find($label_id);
|
|
if (empty($label)) return $this->failure('该标签不存在');
|
|
$label->delete();
|
|
return $this->success('ok');
|
|
} catch (\Exception $e) {
|
|
$this->getError($e);
|
|
return $this->failure('删除标签失败');
|
|
}
|
|
}
|
|
|
|
/**
|
|
* 所有标签记录
|
|
*/
|
|
public function labelHistories(Request $request){
|
|
try {
|
|
$keyword = $request->keyword;
|
|
$histories = LabelHistory::with('user:id,nickname,app_avatar,circle_avatar,mobile,sex','labeledUser:id,nickname,app_avatar,circle_avatar,mobile,sex')->orderBy('created_at','desc');
|
|
if($keyword){
|
|
$keyword = trim($keyword);
|
|
$histories = $histories->whereHas('labeledUser',function($query) use($keyword){
|
|
$query->where('id',$keyword)->orWhere('nickname','like','%'.$keyword.'%')->orWhere('mobile','like','%'.$keyword.'%');
|
|
});
|
|
}
|
|
$histories = $histories->paginate();
|
|
foreach ($histories as $history) {
|
|
$history->content = json_decode($history->content,true);
|
|
}
|
|
return $this->success('ok',$histories);
|
|
} catch (\Exception $e) {
|
|
$this->getError($e);
|
|
return $this->failure('获取标签记录列表失败');
|
|
}
|
|
|
|
}
|
|
|
|
/**
|
|
* 用户个人标签记录
|
|
*/
|
|
public function userLabelHistories(Request $request ,$user_id){
|
|
try {
|
|
$keyword = $request->keyword;
|
|
$histories = LabelHistory::with('user:id,nickname,app_avatar,circle_avatar,mobile,sex,hidden_profile','labeledUser:id,nickname,app_avatar,circle_avatar,mobile,sex')->where('labeled_user_id',$user_id);
|
|
|
|
if($keyword){
|
|
$keyword = trim($keyword);
|
|
$histories = $histories->whereHas('user',function($query) use($keyword){
|
|
$query->where('id',$keyword)->orWhere('nickname','like','%'.$keyword.'%')->orWhere('mobile','like','%'.$keyword.'%');
|
|
});
|
|
}
|
|
$histories = $histories->paginate();
|
|
foreach ($histories as $history) {
|
|
$history->content = json_decode($history->content,true);
|
|
}
|
|
return $this->success('ok',$histories);
|
|
} catch (\Exception $e) {
|
|
$this->getError($e);
|
|
return $this->failure('获取个人标签记录失败');
|
|
}
|
|
|
|
}
|
|
|
|
//删除标签记录
|
|
public function deleteLabelHistory(Request $request,$id){
|
|
try {
|
|
$history = LabelHistory::find($id);
|
|
if (empty($history)) return $this->failure('该记录不存在');
|
|
$history->delete();
|
|
return $this->success('ok');
|
|
} catch (\Exception $e) {
|
|
$this->getError($e);
|
|
return $this->failure('删除失败');
|
|
}
|
|
|
|
}
|
|
|
|
public function updateLabelHistory(Request $request,$id){
|
|
try {
|
|
$history = LabelHistory::find($id);
|
|
if (empty($history)) return $this->failure('该记录不存在');
|
|
$status = $request->input('status',0);
|
|
$history->status = $status;
|
|
$history->save();
|
|
return $this->success('ok',$history);
|
|
} catch (\Exception $e) {
|
|
$this->getError($e);
|
|
return $this->failure('修改失败');
|
|
}
|
|
|
|
}
|
|
|
|
|
|
//--------用户常见问题
|
|
//新建常用问题类型
|
|
public function createCommonQuestionType(Request $request){
|
|
try {
|
|
$name = $request->input('name');
|
|
if (empty($name)) return $this->failure('问题类型不能为空');
|
|
$icon = $request->icon;
|
|
if (empty($icon)) return $this->failure('请选择icon');
|
|
$is_show = $request->input('is_show',0);//默认显示
|
|
$sort = $request->input('sort',0);
|
|
|
|
$q = QuestionType::where('name',$name)->first();
|
|
if (!empty($q)) return $this->failure('不能创建重复问题类型');
|
|
$type = new QuestionType();
|
|
$type->name = $name;
|
|
$type->icon = $icon;
|
|
$type->is_show = $is_show;
|
|
$type->sort = $sort;
|
|
$type->operator = auth()->id();
|
|
$type->save();
|
|
return $this->success('ok',$type);
|
|
} catch (\Exception $e) {
|
|
$this->getError($e);
|
|
return $this->failure('新建类型失败');
|
|
}
|
|
}
|
|
|
|
//修改常见问题类型
|
|
public function updateCommonQuestionType(Request $request,$type_id){
|
|
try {
|
|
$type = QuestionType::find($type_id);
|
|
if (empty($type)) return $this->failure('该类型不存在');
|
|
|
|
if ($request->name && $type->name != $request->name){
|
|
$ty = QuestionType::where('name',$request->name)->first();
|
|
if ($ty) return $this->failure('该类型已存在!');
|
|
$type->name = $request->name;
|
|
}
|
|
if ($request->icon && $type->icon != $request->icon){
|
|
$type->icon = $request->icon;
|
|
}
|
|
if (is_numeric($request->is_show) && $type->is_show != $request->is_show){
|
|
$type->is_show = $request->is_show;
|
|
}
|
|
if (is_numeric($request->sort) && $type->sort != $request->sort){
|
|
$type->sort = $request->sort;
|
|
}
|
|
$type->operator = auth()->id();
|
|
$type->save();
|
|
return $this->success('ok');
|
|
} catch (\Exception $e) {
|
|
$this->getError($e);
|
|
return $this->failure('修改失败');
|
|
}
|
|
}
|
|
|
|
//常见问题类型列表
|
|
public function questionTypes(Request $request){
|
|
try {
|
|
$keyword = $request->keyword;
|
|
$type_id = $request->type_id;
|
|
$types = QuestionType::with('operator')->orderBy('sort','desc');
|
|
if ($keyword) {
|
|
$keyword = trim($keyword);
|
|
$types = $types->where(function($sql) use($keyword){
|
|
$sql->where('name','like','%'.$keyword.'%');
|
|
})->orWhereHas('operator',function($sql) use($keyword){
|
|
$sql->where('id',$keyword)->orWhere('mobile','like','%'.$keyword.'%')->orWhere('nickname','like','%'.$keyword.'%');
|
|
});
|
|
}
|
|
$types = $types->paginate();
|
|
return $this->success('ok',$types);
|
|
} catch (\Exception $e) {
|
|
$this->getError($e);
|
|
return $this->failure('获取列表失败');
|
|
}
|
|
}
|
|
|
|
//常见问题类型--删除
|
|
public function deleteQuestionType(Request $request,$type_id){
|
|
try {
|
|
$type = QuestionType::find($type_id);
|
|
if (!$type) return $this->failure('要删除的类型不存在');
|
|
$type->delete();
|
|
//删除类型 会删除该类型对应的问题
|
|
CommonProblem::where('type_id',$type_id)->delete();
|
|
return $this->success('ok');
|
|
} catch (\Exception $e) {
|
|
$this->getError($e);
|
|
return $this->failure('删除失败');
|
|
}
|
|
}
|
|
|
|
//创建常见问题
|
|
public function createProblem(Request $request){
|
|
try {
|
|
$type_id = $request->type_id;
|
|
if (!$type_id) return $this->failure('先选择这个问题的类型');
|
|
$question = $request->question;
|
|
if (!$question) return $this->failure('请输入问题');
|
|
$answer = $request->answer;
|
|
if (!$answer) return $this->failure('请输入答案');
|
|
$sort = $request->sort ? $request->sort : 0;
|
|
$is_show = $request->is_show ? $request->is_show : 1;
|
|
|
|
$problem = new CommonProblem();
|
|
$problem->type_id = $type_id;
|
|
$problem->question = $question;
|
|
$problem->answer = $answer;
|
|
$problem->sort = $sort;
|
|
$problem->is_show = $is_show;
|
|
$problem->operator = auth()->id();
|
|
$problem->save();
|
|
return $this->success('ok',$problem);
|
|
} catch (\Exception $e) {
|
|
$this->getError($e);
|
|
return $this->failure('创建失败');
|
|
}
|
|
}
|
|
|
|
//常见问题列表
|
|
public function problems(Request $request){
|
|
try {
|
|
$keyword = $request->keyword;
|
|
$type_id = $request->type_id;
|
|
$types = QuestionType::with('commonProblems','commonProblems.operator')->where('id',$type_id)->orderBy('sort','desc')->orderBy('id','desc');
|
|
if($keyword){
|
|
$keyword = trim($keyword);
|
|
$types = $types->where(function($sql) use($keyword){
|
|
$sql->where('name','like','%'.$keyword.'%');
|
|
})->orWhereHas('commonProblems',function($sql) use($keyword){
|
|
$sql->where('question','like','%'.$keyword.'%')->orWhere('answer','like','%'.$keyword.'%');
|
|
});
|
|
}
|
|
$types = $types->paginate();
|
|
return $this->success('ok',$types);
|
|
} catch (\Exception $e) {
|
|
$this->getError($e);
|
|
return $this->failure('获取列表失败');
|
|
}
|
|
}
|
|
|
|
public function updateProblem(Request $request ,$problem_id){
|
|
try {
|
|
$problem = CommonProblem::find($problem_id);
|
|
if (!$problem) return $this->failure('问题不存在');
|
|
|
|
if ($request->question && $problem->question != $request->question){
|
|
$ty = CommonProblem::where('question',$request->question)->first();
|
|
if ($ty) return $this->failure('该问题已存在!');
|
|
$problem->question = $request->question;
|
|
}
|
|
|
|
if ($request->answer && $problem->answer != $request->answer){
|
|
$problem->answer = $request->answer;
|
|
}
|
|
if ($request->type_id && $problem->type_id != $request->type_id){
|
|
$problem->type_id = $request->type_id;
|
|
}
|
|
|
|
if (is_numeric($request->is_show) && $problem->is_show != $request->is_show){
|
|
$problem->is_show = $request->is_show;
|
|
}
|
|
if (is_numeric($request->sort) && $problem->sort != $request->sort){
|
|
$problem->sort = $request->sort;
|
|
}
|
|
|
|
$problem->save();
|
|
return $this->success('ok');
|
|
} catch (\Exception $e) {
|
|
$this->getError($e);
|
|
return $this->failure('修改问题失败');
|
|
}
|
|
}
|
|
|
|
//常见问题删除
|
|
public function delelteProblem(Request $request,$problem_id){
|
|
try {
|
|
$problem = CommonProblem::find($problem_id);
|
|
if (!$problem) return $this->failure('问题不存在');
|
|
$problem->delete();
|
|
return $this->success('ok');
|
|
} catch (\Exception $e) {
|
|
$this->getError($e);
|
|
return $this->failure('删除问题失败');
|
|
}
|
|
|
|
}
|
|
|
|
//============================活动问卷调查模块
|
|
public function addQuestion(Request $request){
|
|
try {
|
|
$titles = Questions::orderBy('id')->pluck('title')->toArray();
|
|
$datas = $request->datas;
|
|
if (!empty($datas)){
|
|
foreach ($datas as $data) {
|
|
// dd($data['title']);
|
|
if (in_array($data['title'],$titles)) continue;
|
|
$question = new Questions();
|
|
$question->title = $data['title'];
|
|
$question->choice = $data['choice'];
|
|
$question->input = $data['input'];
|
|
$question->status = $data['status'];
|
|
$question->sort = $data['sort'];
|
|
$question->desc = $data['desc'];
|
|
$question->Operator = auth()->id();
|
|
$question->save();
|
|
}
|
|
return $this->success('ok');
|
|
}
|
|
|
|
} catch (\Exception $e) {
|
|
$this->getError($e);
|
|
return $this->failure('添加失败');
|
|
}
|
|
|
|
}
|
|
|
|
public function questionList(Request $request){
|
|
try {
|
|
$keyword = $request->keyword;
|
|
$questions = Questions::with('operator')->orderBy('sort','desc')->orderBy('id','desc');
|
|
if ($keyword) {
|
|
$keyword = trim($keyword);
|
|
$questions = $questions->where(function($sql) use($keyword){
|
|
$sql->where('title','like','%'.$keyword.'%');
|
|
})->orWhereHas('operator',function($sql) use($keyword){
|
|
$sql->where('id',$keyword)->orWhere('nickname','like','%'.$keyword.'%')->orWhere('mobile','like','%'.$keyword.'%');
|
|
});
|
|
}
|
|
$questions = $questions->paginate();
|
|
return $this->success('ok',$questions);
|
|
} catch (\Exception $e) {
|
|
$this->getError($e);
|
|
return $this->failure('获取列表失败');
|
|
}
|
|
}
|
|
|
|
public function questionUpdate(Request $request,$id){
|
|
try {
|
|
$question = Questions::find($id);
|
|
if (empty($question)) return $this->failure('该问题不存在');
|
|
if ($request->title && $question->title != $request->title) {
|
|
$question->title = $request->title;
|
|
}
|
|
if (is_numeric($request->choice) && $question->choice != $request->choice) {
|
|
$question->choice = $request->choice;
|
|
}
|
|
if (is_numeric($request->input) && $question->input != $request->input) {
|
|
$question->input = $request->input;
|
|
}
|
|
if (is_numeric($request->status) && $question->status != $request->status) {
|
|
$question->status = $request->status;
|
|
}
|
|
if (is_numeric($request->sort) && $question->sort != $request->sort) {
|
|
$question->sort = $request->sort;
|
|
}
|
|
if ($request->desc && $question->desc != $request->desc) {
|
|
$question->desc = $request->desc;
|
|
}
|
|
$question->save();
|
|
return $this->success('ok');
|
|
} catch (\Exception $e) {
|
|
$this->getError($e);
|
|
return $this->failure('修改失败');
|
|
}
|
|
|
|
}
|
|
|
|
public function questionRemove(Request $request,$id){
|
|
try {
|
|
$question = Questions::find($id);
|
|
if (empty($question)) return $this->failure('该问题不存在');
|
|
$question->delete();
|
|
return $this->success('ok');
|
|
} catch (\Exception $e) {
|
|
$this->getError($e);
|
|
return $this->failure('删除失败');
|
|
}
|
|
|
|
}
|
|
|
|
//配置选项
|
|
public function configOption(Request $request){
|
|
try {
|
|
$datas = $request->datas;
|
|
if (!empty($datas)) {
|
|
foreach ($datas as $data) {
|
|
$op = Options::where('title',$data['title'])->where('remark_status',$data['remark_status'])->where('sort',$data['sort'])->where('status',$data['status'])->first();
|
|
if ($op) continue;
|
|
|
|
$option = new Options();
|
|
$option->title = $data['title'];
|
|
$option->remark_status = $data['remark_status'];
|
|
$option->sort = $data['sort'];
|
|
$option->status = $data['status'];
|
|
$option->Operator = auth()->id();
|
|
$option->save();
|
|
}
|
|
return $this->success('ok');
|
|
}
|
|
} catch (\Exception $e) {
|
|
$this->getError($e);
|
|
return $this->failure('配置选项失败');
|
|
}
|
|
}
|
|
|
|
//选项列表
|
|
public function optionList(Request $request){
|
|
$keyword = $request->keyword;
|
|
$options = Options::with('operator')->orderBy('sort','desc')->orderBy('id','desc');
|
|
if ($keyword) {
|
|
$options = $options->where(function($sql) use($keyword){
|
|
$sql->where('title','like','%'.$keyword.'%');
|
|
})->orWhereHas('operator',function($sql) use($keyword){
|
|
$sql->where('id',$keyword)->orWhere('nickname','like','%'.$keyword.'%')->orWhere('mobile','like','%'.$keyword.'%');
|
|
});
|
|
}
|
|
$options = $options->paginate();
|
|
return $this->success('ok',$options);
|
|
}
|
|
|
|
//修改选项
|
|
public function updateOption(Request $request ,$option_id){
|
|
$option = Options::find($option_id);
|
|
if (empty($option)) return $this->failure('要修改的内容不存在');
|
|
$sort = $request->input('sort',0);
|
|
$status = $request->input('status',0);
|
|
|
|
if ($request->has('sort') && $option->sort != $sort){
|
|
$option->sort = $request->sort;
|
|
}
|
|
if ($request->has('sort') && $option->status != $status){
|
|
$option->status = $request->status;
|
|
}
|
|
$option->save();
|
|
return $this->success('ok');
|
|
}
|
|
|
|
//用户答案
|
|
public function userAnswers(Request $request){
|
|
try {
|
|
$keyword = $request->keyword;
|
|
$activity_id = $request->activity_id;
|
|
$type = $request->type ? $request->type : 'activity';
|
|
$answers = Answers::with('user','questionnaires')->whereHas('questionnaires',function($query) use($type,$activity_id){
|
|
$query->where('type',$type)->where('type_id',$activity_id);
|
|
})->orderBy('created_at','desc');
|
|
if ($keyword) {
|
|
$keyword = trim($keyword);
|
|
$answers = $answers->whereHas('user',function($sql) use($keyword){
|
|
$sql->where('id',$keyword)->orWhere('nickname','like','%'.$keyword.'%')->orWhere('mobile','like','%'.$keyword.'%');
|
|
});
|
|
}
|
|
$answers = $answers->paginate();
|
|
foreach ($answers as $answer) {
|
|
$answer->content = json_decode($answer->content,true);
|
|
$answer->questionnaires->content = json_decode($answer->questionnaires->content,true);
|
|
}
|
|
return $this->success('ok',$answers);
|
|
} catch (\Exception $e) {
|
|
$this->getError($e);
|
|
return $this->failure('获取列表失败');
|
|
}
|
|
|
|
}
|
|
|
|
//问卷配置
|
|
public function configQuestionaires(Request $request){
|
|
$type = $request->input('type','activity');
|
|
// return $request->datas;
|
|
$title = $request->title;
|
|
$type_id = $request->type_id;
|
|
if ($type == 'activity') {
|
|
$title = Activity::find($type_id)->value('theme');
|
|
}
|
|
if (empty($type_id)) return $this->failure('请选择配置哪个活动');
|
|
|
|
// if (empty($title)) return $this->failure('请输入问卷标题');
|
|
$status = $request->input('status',0);
|
|
$begin_time = $request->begin_time;
|
|
$end_time = $request->end_time;
|
|
|
|
$datas = $request->datas;
|
|
// dd($datas);
|
|
$q = new Questionnaire();
|
|
$q->type = $type;
|
|
$q->type_id = $type_id;
|
|
$q->title = $title;
|
|
$q->status = $status;
|
|
$q->begin_time = $begin_time;
|
|
$q->end_time = $end_time;
|
|
$q->content = json_encode($datas);
|
|
$q->save();
|
|
return $this->success('ok');
|
|
}
|
|
|
|
//问卷调查配置列表
|
|
public function questionnairesList(Request $request){
|
|
$keyword = $request->keyword;
|
|
$type_id = $request->type_id;
|
|
$naires = Questionnaire::where('type','activity')->where('type_id',$type_id)->orderBy('status','desc')->orderBy('created_at','desc');
|
|
if ($keyword) {
|
|
$naires = $naires->where(function($sql) use($keyword){
|
|
$sql->where('type_id',$keyword)->where('title','like','%'.$keyword.'%');
|
|
});
|
|
}
|
|
$naires = $naires->paginate();
|
|
foreach ($naires as $naire) {
|
|
$naire->content = json_decode($naire->content,true);
|
|
}
|
|
return $this->success('ok',$naires);
|
|
|
|
}
|
|
|
|
//修改
|
|
public function updateQuestionaires(Request $request,$id){
|
|
$q = Questionnaire::find($id);
|
|
if (empty($q)) return $this->failure('要修改的id 不存在');
|
|
$status = $request->input('status',0);
|
|
$begin_time = $request->begin_time;
|
|
$end_time = $request->end_time;
|
|
$content = $request->content;
|
|
if ($begin_time && $begin_time != $q->begin_time) {
|
|
$q->begin_time = $begin_time;
|
|
}
|
|
if ($status != $q->status) {
|
|
$q->status = $status;
|
|
}
|
|
|
|
if ($end_time && $end_time != $q->end_time) {
|
|
$q->end_time = $end_time;
|
|
}
|
|
|
|
if ($content && $content != json_decode($q->content,true)) {
|
|
$q->content = json_encode($content);
|
|
}
|
|
$q->save();
|
|
return $this->success('ok');
|
|
}
|
|
|
|
public function questionAndOptionList(Request $request){
|
|
$questions = Questions::where('status',1)->select('id','title','choice','input','status','sort')->get();
|
|
$options = Options::where('status',1)->select('id','title','remark_status','sort','status')->get();
|
|
foreach ($options as $option) {
|
|
if ($option->remark_status == 0){
|
|
$option->remark_status = '隐藏输入框';
|
|
}
|
|
if ($option->remark_status == 1){
|
|
$option->remark_status = '显示输入框';
|
|
}
|
|
}
|
|
return $this->success('ok',compact('questions','options'));
|
|
}
|
|
}
|