作者 刘朕
1 个管道 的构建 通过 耗费 1 秒

合并分支 'liuzhen' 到 'master'

Liuzhen



查看合并请求 !115
... ... @@ -7,6 +7,7 @@ use addons\litestore\Litestore;
use addons\litestore\model\Litestoreorder;
use addons\litestore\model\Wxlitestoregoods;
use addons\third\model\Third;
use addons\wechat\library\Config as ConfigService;
use app\admin\model\Litestorenews;
use app\api\model\GoodsMsg;
use app\api\model\LitestoreBanner;
... ... @@ -18,6 +19,7 @@ use app\api\validate\GoodsValidate;
use app\api\validate\StoreValidate;
use app\common\controller\Api;
use EasyWeChat\Foundation\Application as WXPAY_APP;
use EasyWeChat\Foundation\Application;
use EasyWeChat\Payment\Order as WXPAY_ORDER;
use think\Db;
use think\Exception;
... ... @@ -292,6 +294,8 @@ class Goods extends Api
'code':'1',
'msg':'返回成功',
"data": {
"notice": 5,
"qrcode": "20",
"goods":{
"goods_id": 21,
"goods_name": "小米Mix3",
... ... @@ -332,6 +336,13 @@ class Goods extends Api
if($this->request->isPost()){
$param = (new GoodsValidate())->goCheck('goods_detail');
$goods_id = $param['goods_id'];
$openid = Db::name('third')->where('id',$this->auth->id)->value('openid');
$app = new Application(ConfigService::load());
$userService = $app->user;
$user = $userService->get($openid);
// 判断是否关注公众号
$notice = $user->subscribe;
// 商品详情
$detail = Wxlitestoregoods::detail($goods_id);
$imgs=[];
... ... @@ -375,6 +386,8 @@ class Goods extends Api
$detail['goods_price'] = $spec['goods_price'];
$detail['line_price'] = $spec['line_price'];
$return = [
'notice' => $notice,
'qrcode' => cdnurl('/assets/img/qrcode.jpg'),
'goods' => $detail,
'spec' => $specData
];
... ...