QuestionnaireAnswerModel.class.php 958 Bytes
<?php
/**
 * Created by PhpStorm.
 * User: yingcai
 * Date: 2017/10/10
 * Time: 下午4:00
 */

namespace Common\Model;

class QuestionnaireAnswerModel extends \Com\Model
{
    // 构造方法
    public function __construct()
    {
        parent::__construct('Answer', 'oa_questionnaire_');
    }


    public function list_answer_conds($conds = array())
    {

        $params = array();
        // 条件
        $wheres = array();
        if (!$this->_parse_where($wheres, $params, $conds)) {
            return false;
        }
        // 企业标记
        $wheres[] = "`{$this->prefield}domain`=?";
        $params[] = QY_DOMAIN;
        // 状态条件
        $wheres[] = "`{$this->prefield}status`<?";
        $params[] = $this->get_st_delete();

        // 读取记录
        return $this->_m->fetch_array("SELECT uid,count(*) AS total FROM __TABLE__ WHERE " . implode(' AND ',
                $wheres) . " GROUP BY uid ", $params);
    }

}