syay

3.2使用方式

控制器

<?php
namespace Admin\Controller;

class UsersController extends AdminBaseController
{
public function index()
{
    $info = D(\'Users\')->get_one_form($data[\'id\']);
  }
Modle
<?php
namespace Admin\Model;

use Think\Model;

class UsersModel extends Model
{
public function get_one_form($id){
$where[\'id\'] = $id;
$where[\'display\'] = 1;
$info = M(\'Users\')->where($where)->find();
return $info;
}
}

5.0 使用方式
<?php
namespace app\index\controller;
use \think\Cache;
use \think\Controller;
use think\Loader;
use think\Db;
use \think\Cookie;
use \think\Session;
class Activity extends Home
{
public function hot(){
$user = model(\'ActivityList\')->get_one_from_id($style,$user_id);
}
}
<?php
namespace app\index\model;
use \think\Model;
class ActivityList extends Model
{
public function get_one_from_id($style,$id){
$info = $this->where([\'uid\'=>$id,\'style\'=>$style,\'display\'=>0])->order(\'add_time desc\')->select();
return $info;
}
}
  


分类:

技术点:

相关文章:

  • 2021-12-31
  • 2021-10-13
  • 2021-12-31
  • 2021-12-02
  • 2021-08-27
  • 2021-08-27
  • 2021-08-27
  • 2021-08-27
猜你喜欢
  • 2021-10-03
  • 2021-09-26
  • 2021-08-27
  • 2021-08-27
  • 2021-08-27
  • 2021-12-31
  • 2021-12-31
相关资源
相似解决方案