yangsai@163.com 5 months ago
parent ff62473649
commit e6fabb2093
  1. 2
      application/models/Squirrel.php

@ -94,7 +94,7 @@ class SquirrelModel extends Orm_Base{
$cageinfo = $CageModel->field("type")->where("id={$cage}")->fRow(); $cageinfo = $CageModel->field("type")->where("id={$cage}")->fRow();
if($cageinfo['type']==2) { if($cageinfo['type']==2) {
$data = []; $data = [];
$n = $this->field('id,number,sex')->where("is_delete=0 and is_kill=0 and grow_time<'{$time}' and sex=1 and cage={$cage}")->fList(); $n[] = $this->field('id,number,sex')->where("is_delete=0 and is_kill=0 and grow_time<'{$time}' and sex=1 and cage={$cage}")->fRow();
$m = $this->field('id,number,sex')->where("is_delete=0 and is_kill=0 and grow_time<'{$time}' and sex=2 and cage={$cage}")->fList(); $m = $this->field('id,number,sex')->where("is_delete=0 and is_kill=0 and grow_time<'{$time}' and sex=2 and cage={$cage}")->fList();
$data=array_merge(empty($n)?['id'=>0,'number'=>"未知",'sex'=>1]:$n,empty($m)?['id'=>0,'number'=>"未知",'sex'=>2]:$m); $data=array_merge(empty($n)?['id'=>0,'number'=>"未知",'sex'=>1]:$n,empty($m)?['id'=>0,'number'=>"未知",'sex'=>2]:$m);
} }

Loading…
Cancel
Save