application/index/controller/Ajax.php
(开头部分) 8KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
<?php
//声明当前控制器的目录位置
namespace app\index\controller;
//加载TP定义的控制器类,方便继承。
//use think\Controller;
//加载数据库类,方便直接用其工具。think相当于之前用于二开的lib类库
//use app\index\controller\Base;
//use think\Db;
//use think\Session;
//use think\Request;
//use think\Cache;
use app\admin\model\NeedSpace;
use app\admin\model\GoodsSpace;
use app\admin\model\ShopSpace;
use app\admin\model\ArticleSpace;
//use app\admin\lib\lang\Hylang;
//use think\Cache;
//一个类 默认对应 view视图文件夹的 index 文件夹,也代表一个TP所称的控制器
class Ajax extends Base
{
//子类和父类都有initialize方法则会覆盖父类的
public function index()
{
return $this->fetch();
}
//测试
public function test()
{
$data="";
$sign="";
$res="";
$result = (bool)openssl_verify($data, base64_decode($sign), $res, OPENSSL_ALGO_SHA256);
return $result;
}
public function search_keyword()
{
//得到前台发送的字母单词
$key_word= request()->param('value');
if(!$key_word){ return $res;die;}
$NeedSpace= NeedSpace::where(['need_name' =>['like','%'.$key_word.'%']])->where('need_status','>',0)->order('update_time', 'desc')->select();
$GoodsSpace= GoodsSpace::where(['goods_name' =>['like','%'.$key_word.'%']])->where('goods_status','=',2)->order('update_time', 'desc')->select();
$ShopSpace = ShopSpace::where(['shop_name' =>['like','%'.$key_word.'%']])->where('status','=',2)->order('update_time', 'desc')->select();
//输出过滤后的数祖
$res=$this->get_res($NeedSpace,"need_detail","need_name","需求","need_list",$key_word);
$res.=$this->get_res($GoodsSpace,"goods_detail","goods_name","商品","goods_list",$key_word);
$res.=$this->get_res($ShopSpace,"shop_detail","shop_name","服务商","shop_list",$key_word);
return $res;
}
//输出过滤后的数祖
public function get_res($space,$action,$show_filed,$name,$list_action,$key_word)
{
if($space){
$url ="/index/".$action."/index/id/";
foreach ($space as $key => $value) {
if($key<6){
后面还有 151 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。