Commit 9b111407 authored by luhongguang's avatar luhongguang

Merge branch 'feature-deliver210913' into develop

parents f7b14705 e5186ec3
......@@ -34,4 +34,12 @@ class TakePlace extends MysqlBase
$exist = self::getRecord(['take_place_name' => $takePlaceName], ['take_place_id']);
return !empty($exist);
}
public static function save($data, $where = [])
{
if (empty($where)) {
return self::insert($data, []);
}
return self::update($data, $where);
}
}
......@@ -12,7 +12,7 @@ use App\Services\goods\GoodsService;
class MarketinggoodsController extends Base
{
const KS3_BASE_URL = 'ks3-cn-beijing.ksyun.com';
const KS3_BASE_URL = 'ks3-cn-beijing.ksyuncs.com';
/**
* 获取全部生效营销活动商品列表
*
......
......@@ -93,6 +93,6 @@ class BusinessCircleService
unset($where['LIMIT']);
unset($where['ORDER']);
$count = BusinessCircle::count("*", $where);
return ['result' => $list, 'count' => $count];
return ['list' => $list, 'count' => $count];
}
}
\ No newline at end of file
......@@ -9,6 +9,7 @@ namespace App\Services\marketing;
use App\Exception\custom\MarketingException;
use App\Models\marketing\mysql\Tag;
use App\Models\marketing\mysql\TakePlace;
class TagService
{
......@@ -65,7 +66,16 @@ class TagService
$tagId = $params["tag_id"];
$data = [];
$data["is_delete"] = empty($params["is_delete"]) ? 0 : $params["is_delete"];
return Tag::save($data, ["tag_id" => $tagId]);
$deleteRes = Tag::save($data, ["tag_id" => $tagId]);
if (!empty($data["is_delete"])) {
$takePlaceIds = TakePlace::getRecords(["tag_id" => $tagId], ["take_place_id"]);
if (!empty($takePlaceIds)) {
$ids = array_column($takePlaceIds, "take_place_id");
TakePlace::save(["tag_id" => 0], ["take_place_id" => $ids]);
}
}
return $deleteRes;
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment