答案 0 :(得分:1)
我认为它在模型中应该是$query->rows;
,你只需要在控制器中$data['customers'] = $this->model_campaigns_campaign->getCustomers();
,然后在视图中显示它:
<div class="col-sm-5 col-sm-push-1 form-group required">
<label class="col-sm-2 control-label" for="input-campaign-owner"><?php echo $entry_owner; ?></label>
<select name="customer-list" id="customer-list">
<?php foreach ($customers as $customer) { ?>
<option value="<?php echo $customer['customer_id']; ?>"><?php echo $customer['firstname'] . ' ' . $customer['lastname']; ?></option>
<?php } ?>
</select>
</div>
答案 1 :(得分:0)
我认为问题在于你在回声中的引用。此外,echo语句中有/bin/sh: 1: |ew2017: not found
`enter code here`Traceback (most recent call last):
File "<stdin>", line 4, in <module>
File "/usr/lib/python3.5/subprocess.py", line 626, in check_output
**kwargs).stdout
File "/usr/lib/python3.5/subprocess.py", line 708, in run
output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['nmcli d wifi connect abcnetwork password Pass|\\|ew2017;']' returned non-zero exit status 127
和<?php
个标记,这些标记不是必需的。请尝试以下操作,注意对echo语句所做的修改:
?>
此外,您的模型中<select name="customer-list" id="customer-list" >
<?php
foreach ($customer_list as $list){
echo "<option value=''>
$list['customer_firstname']
</option>";
}
?>
可能应为return $query->row;
。