'拼团取消', self::PINTUANORDER_STATE_NORMAL => '参团中', self::PINTUANORDER_STATE_SUCCESS => '拼团成功' ); /** * 获取拼团订单表列表 * @access public * @author o1h.cn * @param type $condition 条件 * @return type */ public function getPpintuanvrorderList($condition) { $ppintuanorder_list = Db::name('ppintuanorder')->alias('ppintuanorder')->field('ppintuanorder.*,vrorder.buyer_id,vrorder.buyer_name,vrorder.order_state') ->join('vrorder vrorder', 'ppintuanorder.order_id=vrorder.order_id','LEFT') ->where($condition) ->select()->toArray(); if (!empty($ppintuanorder_list)) { foreach ($ppintuanorder_list as $key => $ppintuanorder) { $ppintuanorder_list[$key]['pintuanorder_state_text'] = $this->pintuanorder_state_array[$ppintuanorder['pintuanorder_state']]; //参与者头像 $ppintuanorder_list[$key]['pintuanorder_avatar'] = get_member_avatar_for_id($ppintuanorder['buyer_id']); $ppintuanorder_list[$key]['order_state_text'] = get_order_state($ppintuanorder); } } return $ppintuanorder_list; } /** * 获取拼团订单表列表 * @access public * @author o1h.cn * @param type $condition 条件 * @return type */ public function getPpintuanorderList($condition) { $ppintuanorder_list = Db::name('ppintuanorder')->alias('ppintuanorder')->field('ppintuanorder.*,order.buyer_id,order.buyer_name,order.order_state') ->join('order order', 'ppintuanorder.order_id=order.order_id','LEFT') ->where($condition) ->select()->toArray(); if (!empty($ppintuanorder_list)) { foreach ($ppintuanorder_list as $key => $ppintuanorder) { $ppintuanorder_list[$key]['pintuanorder_state_text'] = $this->pintuanorder_state_array[$ppintuanorder['pintuanorder_state']]; //参与者头像 $ppintuanorder_list[$key]['pintuanorder_avatar'] = get_member_avatar_for_id($ppintuanorder['buyer_id']); $ppintuanorder_list[$key]['order_state_text'] = get_order_state($ppintuanorder); } } return $ppintuanorder_list; } /** * 获取拼团订单表列表 * @access public * @author o1h.cn * @param type $condition 条件 * @return type */ public function getOnePpintuanorder($condition) { return Db::name('ppintuanorder')->where($condition)->find(); } /** * 增加拼团订单 * @access public * @author o1h.cn * @param type $data 参数内容 * @return type */ public function addPpintuanorder($data) { return Db::name('ppintuanorder')->insertGetId($data); } /** * 编辑拼团订单 * @access public * @author o1h.cn * @param type $condition 条件 * @param type $data 数据 * @return type */ public function editPpintuanorder($condition, $data) { return Db::name('ppintuanorder')->where($condition)->update($data); } }