wangtengyu
2018-12-07 f459412e0dac4ed94106da043b4c6f8576bfe496
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?php
 
define('IN_ECS', true);
 
require('../includes/init.php');
include('../includes/cls_json.php');
$json   = new JSON;
 
/*
 * 获取商品信息用于分享到朋友圈
 */
if (!empty($_REQUEST['act']) && $_REQUEST['act'] == 'info')
{
 
    $goodsid = (isset($_REQUEST['goodsid']) && intval($_REQUEST['goodsid'])>0) ? intval($_REQUEST['goodsid']) : 0;
 
    if($goodsid>0){
        //商品信息
        $sql = "select goods_name,goods_thumb,goods_img,goods_id from ". $GLOBALS['ecs']->table('goods') ." where goods_id=".$goodsid;
        $row = $GLOBALS['db']->getRow($sql);
        $retinfo = array(
            'thumbImg'=>'http://www.jlv8.com/'.$row['goods_thumb'],
            'wedpageUrl'=>'http://www.jlv8.com/mobile/goods.php?id='.$goodsid,
            'scene'=>1,
            'title'=>$row['goods_name'],
            'description'=>$row['goods_name']
        );
    }
    die($json->encode($retinfo));
}
else if( $_REQUEST['act'] == 'inof')
{
    /*
     *
     *获取商品信息用于分享到会话
     *
     */
    $goodsid = (isset($_REQUEST['goodsid']) && intval($_REQUEST['goodsid'])>0) ? intval($_REQUEST['goodsid']) : 0;
 
    if($goodsid>0){
        //商品信息
        $sql = "select goods_name,goods_thumb,goods_img,goods_id from ". $GLOBALS['ecs']->table('goods') ." where goods_id=".$goodsid;
        $row = $GLOBALS['db']->getRow($sql);
        $retinfo = array(
            'thumbImg'=>'http://www.jlv8.com/'.$row['goods_thumb'],
            'wedpageUrl'=>'http://www.jlv8.com/mobile/goods.php?id='.$goodsid,
            'scene'=>0,
            'title'=>$row['goods_name'],
            'description'=>$row['goods_name']
        );
    }
    die($json->encode($retinfo));
}
?>