ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
获取成为分销商商品信息 ~~~ function get_goods(){ global $_W; $data = m('common')->getPluginset('commission'); $goods = false; if (!empty($data['become_goodsid'])) { foreach ($data['become_goodsid'] as $item_good_id){ $gooditem = pdo_fetch('select id,title,thumb from ' . tablename('ewei_shop_goods') . ' where id=:id and uniacid=:uniacid limit 1 ', array(':id' => $item_good_id, ':uniacid' => $_W['uniacid'])); if ($gooditem){ $goods[] = $gooditem; } } } return $goods; } ~~~ 写入日志 ~~~ load()->func('logging'); logging_run('时间戳:'.time()); ~~~ 跳转 ~~~ mobileUrl($do = '', $query = NULL, $full = false); webUrl($do = '', $query = array(), $full = true); <a href="{php echo webUrl('pc/product',array('tid'=>$row['tid']))}">{php echo put_type($row['tid'])}</a> <a href="/app{php echo mobileUrl('goods.detail',array('id'=>$row['goodsid']))}" target="_blank">{$row['goodsid_text']}</a> ~~~ 设备判断 ~~~ is_weixin() 是否微信 is_h5app() 是否h5应用 is_ios() 是否苹果手机或ipad is_mobile() 是否移动设备 ~~~ 商品搜索选择器,输出 goodsid_text标题和goodsid商品编号 <?php $goods = pdo_fetch('SELECT * FROM ' . tablename('ewei_shop_goods') . ' WHERE id='.$item['goodsid']); echo tpl_selector('goodsid', array( 'preview'=>true, 'readonly'=>true, 'multi'=>0, 'value'=>$item['goodsid_text'], 'url'=>webUrl('goods/query'), 'items'=>$goods, 'nokeywords'=>1, 'autosearch'=>1, 'buttontext'=>'选择产品', 'placeholder'=>'请选择产品') )?> </div>