yangsai@163.com 6 months ago
parent bc217b2148
commit c8ea6a5a08
  1. 2
      application/controllers/Api/Sysset.php
  2. 2
      application/models/Cage.php

@ -54,7 +54,7 @@ class Api_SyssetController extends Ctrl_Api{
$data = $UserModel->field("*")->where("id={$uid}")->fRow();
//获取笼位数量
$Cagemodel = new CageModel();
$CageNum = $Cagemodel->field('count(*) as num')->where("user_id={$uid}")->fRow();
$CageNum = $Cagemodel->field('count(*) as num')->where("c_user_id={$uid}")->fRow();
$data['cage_num'] = $CageNum['num'];
unset($data['password']);
Tool_Fnc::apiMsg('获取成功', '200',$data);

@ -19,7 +19,7 @@ class CageModel extends Orm_Base{
//查询当前笼位一行显示几个
$cagemodel = new CageSetModel();
$shownum = $cagemodel->field('line_num')->where("c_user_id='{$params['uid']}'")->fRow();
$limmit = empty($shownum['line_num'])?20:$shownum['line_num']*5;
$limmit = empty($shownum['line_num'])?20:$shownum['line_num']*4;
$sql = "select id,number,color,strains,type from cage where c_user_id={$params['uid']}";
if(!empty($params['keyword'])){
$sql .=" where number like '%{$params['keyword']}%'";

Loading…
Cancel
Save