getData($where, $callback); } # 获取某个商品的订单 public function getList($info_id, $type = false, $type_id = false, $callback = false) { $where['info_id'] = $info_id; if ($type && $type_id) { $where['type'] = $type; $where['type_id'] = $type_id; } return $this->getData($where, $callback); } public function getData($where, $callback = false) { $order = Dever::db('goods/order')->getData($where); if ($order) { $config = Dever::db('goods/order')->config['get_status']; foreach ($order as $k => $v) { $order[$k]['status_name'] = $config[$v['status']]; $goods = Dever::db('goods/info')->one($v['info_id']); $order[$k]['pic'] = $goods['pic_cover']; $order[$k]['date'] = date('Y-m-d H:i:s', $v['cdate']); $order[$k]['price'] = $v['cash'] * $v['num'] . '元'; if ($callback) { $order[$k] = $callback($order[$k]); } } } return $order; } # 验证是否买过 public function checkBuy($uid, $goods_id) { $where['uid'] = $uid; $where['info_id'] = $goods_id; $where['status'] = 2; return Dever::db('goods/order')->one($where); } }