1, 'type' => $type, 'code' => $code ); $valname = $this->where($where)->value('valname'); return $valname; } /** * 根据类型和值查询备注 订单信息敏感词特殊处理 * @param string $type * @return array */ public function getRemarkByCode($type, $code) { $where = array( 'status' => 1, 'type' => $type, 'code' => $code ); $remark = $this->where($where)->value('remark'); return $remark; } /** * 根据类型和值查询名称 * @param string $type * @return array */ public function getcodeByvalname($type, $valname) { $where = array( 'status' => 1, 'type' => $type, 'valname' => $valname ); $code = $this->where($where)->value('code'); return $code; } /** * 查询多个字典类型 * @param $typeArr * @return false|\PDOStatement|string|\think\Collection * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\ModelNotFoundException * @throws \think\exception\DbException */ public static function dictionaryMultiType($typeArr) { return self::where(['type' => ['in', $typeArr], 'status' => 1])->field('type,code,valname')->select(); } }