1. Search template In the corresponding index.html Add the search template to the bottom of the page
<script id="customformtpl" type="text/html">
<!--form Form must be added form-commsearch This class --> <form action="" class="form-commonsearch">
<div
style="border-radius:2px;margin-bottom:10px;background:#f5f5f5;padding:15px
20px;"> <!--<h4> Custom search form </h4>--> <hr> <div class="row"> <div class="col-xs-3
col-sm-3 col-md-3"> <div class="form-group"> <!--<input type="hidden"
class="operate" data-name="city" value="="/>--> <label
class="control-label"> User selection </label> <div> <input id="user_id"
data-rule="required" data-source="user/index" data-field="nick_name"
class="form-control selectpage" placeholder=" Please select user " name="user_id" type="text"
value="0"> </div> </div> </div> <!--<div class="col-xs-3 col-sm-3 col-md-3">-->
<!--<div class="form-group">--> <!--<label
class="control-label"> Date filter </label>--> <!--<div>--> <!--<input type="text"
autocomplete="off" class="form-control datetimerange" id="dktime"
placeholder="" value="" name="dktime"/>--> <!--</div>--> <!--</div>-->
<!--</div>--> <div class="col-xs-6 col-sm-6 col-md-3"> <div class="form-group">
<label class="control-label"></label> <div class="row"> <div class="col-xs-3">
<input type="button" id="tj" class="btn btn-success btn-block" value=" Submit "/>
</div> <div class="col-xs-3"> <input type="reset" class="btn btn-primary
btn-block" value=" Reset "/> </div> </div> </div> </div> </div> </div> </form>
</script>
( supplement ): In the corresponding js Add in     searchFormTemplate: 'customformtpl', The search uses the template , With the place where the search is turned off

2.js adjustment , In the corresponding js Of index Method to add a click event

 
$('#tj').click(function () { var upload = ""; upload = layer.msg(' Searching ...', {
icon: 16 , shade: 0.2, time: false }); // layer.msg(' Correction center '); var user_id =
$("#user_id").val(); var dktime = $("#dktime").val(); $.ajax({ type:'POST', //
url:"Ajax/setdkSession", url:"Ajax/setwrongquestionSession", dataType:'json',
data:{user_id:user_id,dktime:dktime}, async:false, success:function (ret) {
$(".btn-refresh").trigger("click"); layer.close(upload); },error:function (e) {
} }) })
 

3. Cache processing The corresponding controller method above     In the current controller Ajax/setwrongquestionSession
/* Set the wrong question to find the user's punch in session*/ public function setwrongquestionSession(){
$param=$this->request->param(); session('searchwrongquestion',$param);
$this->success('',null,$param); }
4. Controller processing stay     if ($this->request->isAjax()) { 
Add the code shown below , Then add two more where($map) The conditions are fine
$map=array(); if(session('searchwrongquestion')){
if(session('searchwrongquestion')['user_id']!=0){
$map['user_id']=session('searchwrongquestion')['user_id']; } }
design sketch :

Technology
©2019-2020 Toolsou All rights reserved,
2020 The 11th National Blue Bridge Cup C/C++b Group summary ( Completion ) Review of the most complete computer network principles in history vue-cli 3 VUE Scaffold project construction ( Detailed explanation ) solve Vue+TypeScript Under development TS Don't recognize this.$refs The question of Vue Using the function of anti chattering and throttling How to use division operation in relational algebra SQL Statement representation ?copy-webpack-plugin Copy and compress files avue The use of dictionaries in English Teaching girls to learn Java: What is? Java?python Code painting Cherry Blossom -python Draw cherry tree code Specific code introduction