我想代替库存提醒产品,显示到期日期提醒产品。
<?php
foreach ($stock as $item) {
echo '<li class="list-group-item"><span class="badge badge-danger float-xs-right">' . +$item['qty'] . ' ' . $item['unit'] . '</span> <a href="' . base_url() . 'products/edit?id=' . $item['pid'] . '">' . $item['product_name'] . ' </a><small class="purple"> <i class="ft-map-pin"></i> ' . $item['title'] . '</small>
</li>';
} ?>
和
public function stock()
{
$whr = '';
if ($this->aauth->get_user()->loc) {
$whr = ' AND (lmpos_warehouse.loc=' . $this->aauth->get_user()->loc . ')';
} elseif (!BDATA) {
$whr = ' AND (lmpos_warehouse.loc=0)';
}
$query = $this->db->query("SELECT lmpos_products.*,lmpos_warehouse.title FROM lmpos_products LEFT JOIN lmpos_warehouse ON lmpos_products.warehouse=lmpos_warehouse.id WHERE (lmpos_products.qty<=lmpos_products.alert) $whr ORDER BY lmpos_products.product_name ASC LIMIT 10");
return $query->result_array();
}
注意:在数据库中的产品表中,每个产品都有一个有效期
慕莱坞森