where($condition)->field($field)->order($order)->paginate(['list_rows'=>$pagesize,'query' => request()->param()],false); $this->page_info=$res; return $res->items(); }else{ return Db::name('storesnstracelog')->where($condition)->field($field)->order($order)->limit($limit)->select()->toArray(); } } /** * 获得店铺动态总数 * @access public * @author csdeshang * @param array $condition 条件 * @return int */ public function getStoresnstracelogCount($condition) { return Db::name('storesnstracelog')->where($condition)->count(); } /** * 获取单条店铺动态 * @access public * @author csdeshang * @param array $condition 条件 * @return array */ public function getStoresnstracelogInfo($condition) { return Db::name('storesnstracelog')->where($condition)->find(); } /** * 保存店铺动态 * @access public * @author csdeshang * @param array $data 数据 * @return boolean */ public function addStoresnstracelog($data) { return Db::name('storesnstracelog')->insertGetId($data); } /** * 保存店铺动态 * @access public * @author csdeshang * @param array $data 数据 * @return boolean */ public function addStoresnstracelogAll($data) { return Db::name('storesnstracelog')->insertAll($data); } /** * 更新店铺动态 * @access public * @author csdeshang * @param array $update 更新数据 * @param array $condition 条件 * @return boolean */ public function editStoresnstracelog($update, $condition) { return Db::name('storesnstracelog')->where($condition)->update($update); } /** * 删除店铺动态 * @access public * @author csdeshang * @param array $condition 条件 * @return boolean */ public function delStoresnstracelog($condition) { return Db::name('storesnstracelog')->where($condition)->delete(); } /** * 拼写个类型样式 * @param type $type 动态类型 * @param type $data 相关数据 * @return string */ public function spellingStyle($type,$data){ //1'relay',2'normal',3'new',4'coupon',5'xianshi',6'mansong',7'bundling',8'groupbuy',9'recommend',10'hotsell' $rs = ''; switch ($type){ case '2': break; case '3': $rs = "
$data['goods_id'])) . "\">\""
" . lang('store_sns_new_selease') . "$data['goods_id'])) . "\">" . $data['goods_name'] . "
" . lang('sns_sharegoods_price') . lang('ds_colon') . lang('currency') . ds_price_format($data['goods_price']) . "
" . ((isset($data['goods_transfee_charge']) && $data['goods_transfee_charge'] == '1') ? lang('store_sns_free_shipping') : lang('sns_sharegoods_freight') . lang('ds_colon') . lang('currency') . ds_price_format($data['goods_freight'])) . "
" . lang('sns_sharegoods_collect') . "
"; break; case '4': $rs = "
$data['coupon_id'], 'id' => $data['store_id'])) . "\">\""
" . lang('store_sns_coupon') . " $data['coupon_id'], 'id' => $data['store_id'])) . "\">" . $data['coupon_title'] . "
" . lang('store_sns_coupon_price') . lang('ds_colon') . lang('currency') . ds_price_format($data['coupon_price']) . "
" . lang('store_sns_start-stop_time') . lang('ds_colon') . date('Y-m-d H:i', $data['coupon_start_date']) . "~" . date('Y-m-d H:i', $data['coupon_end_date']) . "
"; break; case '5': $rs = "
$data['goods_id'])) . "\">\""
" . lang('store_sns_xianshi') . "$data['goods_id'])) . "\">" . $data['goods_name'] . "
" . lang('sns_sharegoods_price') . lang('ds_colon') . lang('currency') . ds_price_format($data['goods_price']) . "
" . lang('store_sns_formerprice') . lang('ds_colon') . lang('currency') . ds_price_format($data['xianshigoods_price']) . "
" . lang('sns_sharegoods_collect') . "
"; break; case '6': $rs = "
$data['store_id'])) . "\">\"".$data['mansong_name']."\"
" . lang('store_sns_mansong') . "$data['store_id'])) . "\">" . $data['mansong_name'] . "
" . lang('store_sns_start-stop_time') . lang('ds_colon') . date('Y-m-d H:i', $data['mansong_starttime']) . "~" . date('Y-m-d H:i', $data['mansong_endtime']) . "
"; break; case '7': $rs = "
$data['goods_id'])) . "\">\""
" . lang('store_sns_bundling') . "$data['goods_id'])) . "\">".$data['bl_name']."
" . lang('store_sns_bundling_price') . lang('ds_colon') . lang('currency') . ds_price_format($data['bl_discount_price']) . "
" . (($data['bl_freight_choose']==1) ? lang('store_sns_free_shipping') : lang('sns_sharegoods_freight') . lang('ds_colon') . lang('currency') . ds_price_format($data['bl_freight'])) . "
"; break; case '8': $rs = "
$data['goods_id'])) . "\">\""
" . lang('store_sns_groupbuy') . "$data['goods_id'])) . "\">" . $data['group_name'] . "
" . lang('store_sns_goodsprice') . lang('ds_colon') . lang('currency') . ds_price_format($data['goods_price']) . "
" . lang('store_sns_groupprice') . lang('ds_colon') . lang('currency') . ds_price_format($data['groupbuy_price']) . "
" . lang('store_sns_start-stop_time') . lang('ds_colon') . date('Y-m-d H:i', $data['start_time']) . "~" . date('Y-m-d H:i', $data['end_time']) . "
"; break; case '9': $rs = "
$data['goods_id'])) . "\">\""
" . lang('store_sns_store_recommend') . "$data['goods_id'])) . "\">" . $data['goods_name'] . "
" . lang('sns_sharegoods_price') . lang('ds_colon') . lang('currency') . ds_price_format($data['goods_price']) . "
" . lang('sns_sharegoods_freight') . lang('ds_colon') . lang('currency') . ds_price_format($data['goods_freight']) . "
" . lang('sns_sharegoods_collect') . "
"; break; case '10': $rs = "
$data['goods_id'])) . "\">\""
" . lang('store_sns_hotsell') . "$data['goods_id'])) . "\">" . $data['goods_name'] . "
" . lang('sns_sharegoods_price') . lang('ds_colon') . lang('currency') . ds_price_format($data['goods_price']) . "
" . lang('sns_sharegoods_freight') . lang('ds_colon') . lang('currency') . ds_price_format($data['goods_freight']) . "
" . lang('sns_sharegoods_collect') . "
"; break; } return $rs; } }