24 lines
553 B
PHP
24 lines
553 B
PHP
<?php
|
|
|
|
class Breeding_plan_model extends MY_Model
|
|
{
|
|
protected $table = 'breeding_plan';
|
|
protected $join = [];
|
|
protected $keyword_field = ['user_id'];
|
|
protected $list_field = 'base.*';
|
|
protected $where_field_map = [];
|
|
protected $null_field = ['s.id'];
|
|
protected $unique_field = 'id';
|
|
|
|
//获取用户的计划总数
|
|
public function getUserTotal($user_id)
|
|
{
|
|
$this->db->select('count(*) as count');
|
|
$this->db->from($this->table);
|
|
$this->db->where('user_id', $user_id);
|
|
$list = $this->db->get()->row_array();
|
|
return $list['count'];
|
|
}
|
|
|
|
}
|