array( '_table' => 'ls_retail_spellgroup', 'id', 'gid', 'storeid' => 'store_id', 'merchantid' => 'merchant_id', 'group_skuid' => 'group_sku_id', 'actname' => 'act_name', 'number', 'starttime' => 'start_time', 'endtime' => 'end_time', 'day', 'hour', 'min', 'acttype' => 'act_type', 'rules', 'item', 'rise_num', 'actprice' => 'act_price', 'actnum' => 'act_num', 'addtime' => 'add_time', 'attribute', 'is_club_card', 'send_type', 'join_time', 'team_up', 'sell_number', 'delivery_template_id', 'is_recommend' ), 'RetailGoods' => array( '_table' => 'ls_retail_goods', 'goods_name', 'goods_code', 'goods_number', 'goods_class_id', 'purchase_price', 'online_price', 'goods_num', 'company', 'details', 'attribute_state', 'shop_mem_status', 'shop_mem_price', 'plus_mem_status', 'plus_price', 'goods_img_id', 'integral_mem_status', 'integral', 'online_state', 'status', 'weight_value', 'video_id', 'serial_number_state', 'pricing_method', 'third_goods_code', '_on' => 'RetailGroup.gid = RetailGoods.id', ), ); /** * 查询单条数据(find) * @param array $map 条件 * @param string $field 字段 '*' * @return array|bool $find|false */ public function getFind($map, $field = '*') { if (!$map) { return false; } $find = $this->field($field)->where($map)->find(); return $find; } /** * 多条查询(select) * @param [array] $map 条件 * @param [int] $page 分页 * @param [int] $limit 数量 * @return [array|bool] $res|false */ /** * @param $map 条件 * @param string $field 获取的字段 * @param string $page 分页 * @param string $limit 数量 * @param string $order 排序 * @return bool|mixed $res|false */ public function getSelect($map, $field = '*', $page = '', $limit = '', $order = 'id asc') { if (!$map) { return false; } if (!$page || !$limit) { $select = $this->field($field)->where($map)->order($order)->select(); } else { $select = $this->field($field)->where($map)->order($order)->page($page, $limit)->select(); } return $select; } /** * 统计数量(count) * @parma [array] $map 条件 * @return [array|bool] $res|false */ public function getCount($map) { if (!$map) { return 0; } $count = $this->where($map)->count(); return $count ? $count : 0; } }