market_activity_1118

This commit is contained in:
dengbw
2022-11-18 22:38:27 +08:00
committed by xiaoyu
parent 85e80c409c
commit b59d84149f
4 changed files with 33 additions and 16 deletions
+15 -6
View File
@@ -58,7 +58,7 @@ class Activity extends BaseController
$dateRange = [$v['timeStart'], $v['timeEnd']];
$status = intval($v['status']);
$activityId = intval($v['activityId']);
$bgImg = $channelImg = $sharePhoto = $shareImg = $shareTitle = $bizIds = $teamIds = $pay = [];
$bgImg = $channelImg = $banner = $sharePhoto = $shareImg = $shareTitle = $bizIds = $teamIds = $pay = [];
$item = ['activityId' => $activityId, 'itemImg' => [], 'title' => '', 'introduction' => '', 'price' => '', 'stock' => '', 'dateRange' => ''];
$coupon = ['activityId' => $activityId, 'img' => [], 'title' => '', 'rules' => '', 'price' => '', 'dateRange' => ''];
$pay = ['way' => 1, 'price' => '', 'img' => []];
@@ -103,6 +103,9 @@ class Activity extends BaseController
$pay['img'] = [];
}
}
if ($jsondata['banner']) {
$banner = [['uid' => 1, 'fileUrl' => $jsondata['banner'], 'url' => build_qiniu_image_url($jsondata['banner']), 'status' => 'done']];
}
if ($v['bgImg']) {
$bgImg = [['uid' => 1, 'fileUrl' => $v['bgImg'], 'url' => build_qiniu_image_url($v['bgImg']), 'status' => 'done']];
}
@@ -135,7 +138,7 @@ class Activity extends BaseController
$list[] = [
'activityId' => $activityId, 'title' => $v['title'], 'channelId' => $v['channelId'], 'bizIds' => $bizIds, 'teamIds' => $teamIds, 'pay' => $pay,
'introduction' => $v['introduction'], 'shareTitle' => $shareTitle, 'dateRange' => $dateRange, 'coupon' => $coupon, 'drawCode' => $v['drawCode'],
'bgImg' => $bgImg, 'channelImg' => $channelImg, 'sharePhoto' => $sharePhoto, 'shareImg' => $shareImg, 'item' => $item, 'url' => $url,
'bgImg' => $bgImg, 'channelImg' => $channelImg, 'banner' => $banner, 'sharePhoto' => $sharePhoto, 'shareImg' => $shareImg, 'item' => $item, 'url' => $url,
's_time' => $v['timeStart'], 'e_time' => $v['timeEnd'], 'status' => $status, 'createTime' => $v['createTime']];
}
}
@@ -163,6 +166,7 @@ class Activity extends BaseController
$teamIds = $this->input_param('teamIds');
$pay = $this->input_param('pay');
$drawCode = $this->input_param('drawCode');
$banner = $this->input_param('banner');
if (!$title) {
$this->return_json('请输入活动标题');
}
@@ -185,8 +189,9 @@ class Activity extends BaseController
// $this->return_json('请输入活动简介');
// }
$bgImg = $bgImg[0]['fileUrl'];
$sharePhoto = $sharePhoto[0]['fileUrl'] ? $sharePhoto[0]['fileUrl'] : '';
$channelImg = $channelImg[0]['fileUrl'] ? $channelImg[0]['fileUrl'] : '';
$sharePhoto = $sharePhoto ? $sharePhoto[0]['fileUrl'] : '';
$channelImg = $channelImg ? $channelImg[0]['fileUrl'] : '';
$banner = $banner ? $banner[0]['fileUrl'] : '';
$shareTitle = $shareTitle ? json_encode($shareTitle, JSON_UNESCAPED_UNICODE) : '';
$setShareImg = '';
if ($shareImg) {
@@ -201,6 +206,7 @@ class Activity extends BaseController
$pay = ['way' => 1, 'price' => '', 'img' => []];
}
$jsondata['pay'] = $pay;
$jsondata['banner'] = $banner;
$jsondata = json_encode($jsondata, JSON_UNESCAPED_UNICODE);
$addDate = ['title' => $title, 'bgImg' => $bgImg, 'channelImg' => $channelImg, 'channelId' => $channelId, 'jsondata' => $jsondata
, 'introduction' => $introduction, 'shareTitle' => $shareTitle, 'sharePhoto' => $sharePhoto, 'shareImg' => $setShareImg, 'drawCode' => $drawCode
@@ -295,6 +301,7 @@ class Activity extends BaseController
$teamIds = $this->input_param('teamIds');
$pay = $this->input_param('pay');
$drawCode = $this->input_param('drawCode');
$banner = $this->input_param('banner');
if (!$activityId) {
$this->return_json('参数错误');
}
@@ -377,8 +384,9 @@ class Activity extends BaseController
$this->mdSyliveActivityTeam->update(['status' => -1], ['activityId' => $activityId, 'status' => 0]);
}
$bgImg = $bgImg[0]['fileUrl'];
$sharePhoto = $sharePhoto[0]['fileUrl'] ? $sharePhoto[0]['fileUrl'] : '';
$channelImg = $channelImg[0]['fileUrl'] ? $channelImg[0]['fileUrl'] : '';
$sharePhoto = $sharePhoto ? $sharePhoto[0]['fileUrl'] : '';
$channelImg = $channelImg ? $channelImg[0]['fileUrl'] : '';
$banner = $banner ? $banner[0]['fileUrl'] : '';
$shareTitle = $shareTitle ? json_encode($shareTitle, JSON_UNESCAPED_UNICODE) : '';
$setShareImg = '';
if ($shareImg) {
@@ -394,6 +402,7 @@ class Activity extends BaseController
$pay = ['way' => 1, 'price' => '', 'img' => []];
}
$jsondata['pay'] = $pay;
$jsondata['banner'] = $banner;
$jsondata = json_encode($jsondata, JSON_UNESCAPED_UNICODE);
$organizationIds = $organizationIds ? ',' . implode(',', $organizationIds) . ',' : '';
$upDate = ['title' => $title, 'bgImg' => $bgImg, 'channelImg' => $channelImg, 'channelId' => $channelId, 'introduction' => $introduction,
+6 -4
View File
@@ -68,7 +68,7 @@ class Goods extends BaseController
$list[] = ['itemId' => $v['itemId'], 'activityId' => $v['activityId'], 'title' => $v['title'], 'banner' => $banner
, 'dateRange' => $dateRange, 'useRange' => $useRange, 'descrip' => $v['descrip'], 'price' => $v['price'], 'stock' => $v['stock']
, 'timeStart' => $timeStart, 'sort' => $v['sort'], 'status' => intval($v['status']), 'createTime' => $v['createTime']
, 'type' => intval($v['type']), 'typeName' => $this->mdSyliveItems->typeAry($v['type']), 'url' => $url];
, 'ifAddress' => intval($v['ifAddress']), 'type' => intval($v['type']), 'typeName' => $this->mdSyliveItems->typeAry($v['type']), 'url' => $url];
}
}
$date = ['list' => $list, 'count' => $count];
@@ -103,6 +103,7 @@ class Goods extends BaseController
$price = $this->input_param('price');
$stock = $this->input_param('stock');
$sort = $this->input_param('sort');
$ifAddress = intval($this->input_param('ifAddress'));
$dateRange = $this->input_param('dateRange');
$useRange = $this->input_param('useRange');
$type = intval($this->input_param('type'));
@@ -113,7 +114,7 @@ class Goods extends BaseController
$this->return_json('请输入商品标题');
}
$addDate = ['activityId' => $activityId, 'title' => $title, 'price' => $price, 'stock' => $stock, 'sort' => $sort
, 'descrip' => $descrip, 'type' => $type, 'createTime' => date('Y-m-d H:i:s')];
, 'ifAddress' => $ifAddress, 'descrip' => $descrip, 'type' => $type, 'createTime' => date('Y-m-d H:i:s')];
$addDate['timeStart'] = $dateRange[0] ? $dateRange[0] : '0000-00-00 00:00:00';
$addDate['timeEnd'] = $dateRange[1] ? $dateRange[1] : '0000-00-00 00:00:00';
$addDate['useStart'] = $useRange[0] ? $useRange[0] : '0000-00-00 00:00:00';
@@ -146,7 +147,8 @@ class Goods extends BaseController
$descrip = $this->input_param('descrip');
$price = $this->input_param('price');
$stock = $this->input_param('stock');
$sort = $this->input_param('sort');
$sort = intval($this->input_param('sort'));
$ifAddress = intval($this->input_param('ifAddress'));
$dateRange = $this->input_param('dateRange');
$useRange = $this->input_param('useRange');
$type = intval($this->input_param('type'));
@@ -161,7 +163,7 @@ class Goods extends BaseController
$this->return_json('商品不存在');
}
$upDate = ['title' => $title, 'price' => $price, 'stock' => $stock, 'sort' => $sort
, 'descrip' => $descrip, 'type' => $type];
, 'ifAddress' => $ifAddress, 'descrip' => $descrip, 'type' => $type];
$upDate['timeStart'] = $dateRange[0] ? $dateRange[0] : '0000-00-00 00:00:00';
$upDate['timeEnd'] = $dateRange[1] ? $dateRange[1] : '0000-00-00 00:00:00';
$upDate['useStart'] = $useRange[0] ? $useRange[0] : '0000-00-00 00:00:00';
@@ -116,8 +116,8 @@ class Organization extends BaseController
$this->return_json('选择的上级机构不能保存,请重新选择');
}
}
$logo = $logo[0]['fileUrl'] ? $logo[0]['fileUrl'] : '';
!$comments && $comments = '';
$logo = $logo[0]['fileUrl'] ? $logo[0]['fileUrl'] : '';
$addDate = ['parentId' => $parentId, 'organizationName' => $organizationName, 'organizationFullName' => $organizationFullName
, 'organizationType' => $organizationType, 'sortNumber' => $sortNumber, 'comments' => $comments, 'logo' => $logo
, 'createTime' => date('Y-m-d H:i:s')];
@@ -149,8 +149,6 @@ class Organization extends BaseController
$comments = $this->input_param('comments');
$city = $this->input_param('city');
$logo = $this->input_param('logo');
$logo = $logo[0]['fileUrl'] ? $logo[0]['fileUrl'] : '';
!$comments && $comments = '';
if ($_SESSION['brandName']) {//品牌机构
$re_org = $this->mdSyliveOrganization->get(['organizationId' => $organizationId]);
if ($re_org && $re_org['parentId'] == 0) {//一级品牌不可修改字段
@@ -175,6 +173,7 @@ class Organization extends BaseController
}
}
!$comments && $comments = '';
$logo = $logo ? $logo[0]['fileUrl'] : '';
$upDate = ['parentId' => $parentId, 'organizationName' => $organizationName, 'organizationFullName' => $organizationFullName
, 'organizationType' => $organizationType, 'sortNumber' => $sortNumber, 'comments' => $comments, 'logo' => $logo];
if ($city) {
+10 -3
View File
@@ -64,6 +64,10 @@ class Team extends BaseController
$city[] = $v['cityId'];
}
$res[$k]['city'] = $city;
if ($v['logo']) {
$logo[] = ['uid' => 1, 'fileUrl' => $v['logo'], 'url' => build_qiniu_image_url($v['logo']), 'status' => 'done'];
}
$res[$k]['logo'] = $logo;
}
$this->return_response_list($res);
}
@@ -82,6 +86,7 @@ class Team extends BaseController
$city = $this->input_param('city');
$teamType = $this->input_param('teamType');
$organizationId = intval($this->input_param('organizationId'));
$logo = $this->input_param('logo');
if (!$teamName) {
$this->return_json('请输入团队名称');
}
@@ -89,8 +94,9 @@ class Team extends BaseController
$this->return_json('请选择所属团队');
}
!$comments && $comments = '';
$logo = $logo ? $logo[0]['fileUrl'] : '';
$addDate = ['parentId' => $parentId, 'teamName' => $teamName, 'sortNumber' => $sortNumber, 'comments' => $comments
, 'teamType' => $teamType, 'organizationId' => $organizationId, 'createTime' => date('Y-m-d H:i:s')];
, 'teamType' => $teamType, 'organizationId' => $organizationId, 'logo' => $logo, 'createTime' => date('Y-m-d H:i:s')];
if ($city) {
$addDate['provinceId'] = intval($city[0]);
$addDate['cityId'] = intval($city[1]);
@@ -117,7 +123,7 @@ class Team extends BaseController
$city = $this->input_param('city');
$teamType = $this->input_param('teamType');
$organizationId = intval($this->input_param('organizationId'));
!$comments && $comments = '';
$logo = $this->input_param('logo');
if (!$teamId) {
$this->return_json('参数错误');
}
@@ -128,8 +134,9 @@ class Team extends BaseController
$this->return_json('请选择所属团队');
}
!$comments && $comments = '';
$logo = $logo ? $logo[0]['fileUrl'] : '';
$upDate = ['parentId' => $parentId, 'teamName' => $teamName, 'sortNumber' => $sortNumber, 'comments' => $comments
, 'teamType' => $teamType, 'organizationId' => $organizationId];
, 'teamType' => $teamType, 'organizationId' => $organizationId, 'logo' => $logo];
if ($city) {
$upDate['provinceId'] = intval($city[0]);
$upDate['cityId'] = intval($city[1]);