feature/main20240421
郭嘉 8 months ago
parent 5df25145e6
commit 2aca9e3047
  1. 7
      app/api/controller/Square.php
  2. 1
      public/install/data/install_struct.sql

@ -20,6 +20,7 @@ use app\api\model\Square as squareModel;
use app\api\model\Squarelike as squarelikeModel; use app\api\model\Squarelike as squarelikeModel;
use app\common\model\UploadFile; use app\common\model\UploadFile;
use app\common\model\Channel; use app\common\model\Channel;
use app\api\model\Goods as GoodsModel;
/** /**
* 广场动态 * 广场动态
@ -77,6 +78,7 @@ class Square extends Controller
$like = $modelLike->where(['user_name' => $useInfo['user_id'],'square_id' => $r['square_id']])->find(); $like = $modelLike->where(['user_name' => $useInfo['user_id'],'square_id' => $r['square_id']])->find();
$res[$kr]['imgs'] = []; $res[$kr]['imgs'] = [];
$res[$kr]['goodsInfo'] = [];
$list['data'][$kr]['isLike'] = !empty($like) ? true : false; $list['data'][$kr]['isLike'] = !empty($like) ? true : false;
$res[$kr]['avatar_url'] = []; $res[$kr]['avatar_url'] = [];
if ($r['imgs']) { if ($r['imgs']) {
@ -88,6 +90,11 @@ class Square extends Controller
$files = UploadFile::getFileList([$user['avatar_id']]); $files = UploadFile::getFileList([$user['avatar_id']]);
$list['data'][$kr]['avatar_url'] = $files ?: null; $list['data'][$kr]['avatar_url'] = $files ?: null;
} }
if ($r['goods_id']) {
$modelgoods = new GoodsModel;
$goods = $modelgoods->getDetails2($r['goods_id'])->toArray();
$res[$kr]['goodsInfo'] = $goods;
}
} }
return $this->renderSuccess($list); return $this->renderSuccess($list);
} }

@ -1745,6 +1745,7 @@ CREATE TABLE `yoshop_style` (
DROP TABLE IF EXISTS `yoshop_square`; DROP TABLE IF EXISTS `yoshop_square`;
CREATE TABLE `yoshop_square` ( CREATE TABLE `yoshop_square` (
`square_id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '动态ID', `square_id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '动态ID',
`goods_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '商品ID',
`store_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '商城ID', `store_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '商城ID',
`merchant_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '商户ID、商店ID 隔离商城里面的商户', `merchant_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '商户ID、商店ID 隔离商城里面的商户',
`imgs` varchar(200) NOT NULL DEFAULT '' COMMENT '图片ID', `imgs` varchar(200) NOT NULL DEFAULT '' COMMENT '图片ID',

Loading…
Cancel
Save