search($where)->group($group)->column($field, $key); } /** * 获取运费模板列表 * @param array $where * @param string $field * @param string $key * @return array */ public function getShippingArray(array $where, string $field, string $key) { return $this->search($where)->column($field, $key); } /** * 根据运费模板id和城市id获得包邮数据列表 * @param array $tempIds * @param array $cityId * @param string $field * @param string $key * @return array */ public function getTempRegionList(array $tempIds, array $cityId, string $field = '*', string $key = '*') { return $this->getModel()->whereIn('temp_id', $tempIds)->whereIn('city_id', $cityId)->order('city_id asc')->column($field, $key); } /** * 获取列表 * @param array $where * @param array|string[] $field * @return array * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException */ public function getShippingList(array $where, array $field = ['*']) { return $this->search($where)->field($field)->select()->toArray(); } }