|
|
@@ -5,10 +5,11 @@ namespace business\controllers;
|
|
|
use biz\merchant\services\ShopService;
|
|
|
use common\components\dirUtil;
|
|
|
use common\components\util;
|
|
|
+use Yii;
|
|
|
|
|
|
class ShopController extends BaseController
|
|
|
{
|
|
|
-
|
|
|
+
|
|
|
//门店列表 shish 20202.2.29
|
|
|
public function actionList()
|
|
|
{
|
|
|
@@ -17,6 +18,27 @@ class ShopController extends BaseController
|
|
|
util::success($list);
|
|
|
}
|
|
|
|
|
|
+ //更新门店 shish 2020.2.29
|
|
|
+ public function actionUpdate()
|
|
|
+ {
|
|
|
+ $data = Yii::$app->request->post();
|
|
|
+ $data['merchantId'] = $this->merchantId;
|
|
|
+ $id = isset($data['id']) ? $data['id'] : 0;
|
|
|
+ unset($data['id']);
|
|
|
+ $shop = ShopService::getById($id);
|
|
|
+ ShopService::valid($shop, $this->merchantId);
|
|
|
+ ShopService::updateShop($id, $data);
|
|
|
+ util::ok();
|
|
|
+ }
|
|
|
+
|
|
|
+ public function actionAdd()
|
|
|
+ {
|
|
|
+ $data = Yii::$app->request->post();
|
|
|
+ $data['merchantId'] = $this->merchantId;
|
|
|
+ ShopService::addShop($data);
|
|
|
+ util::ok();
|
|
|
+ }
|
|
|
+
|
|
|
//下载收款码 shish 2020.2.29
|
|
|
public function actionDownloadGatheringCode()
|
|
|
{
|
|
|
@@ -24,6 +46,9 @@ class ShopController extends BaseController
|
|
|
$shop = ShopService::getById($id);
|
|
|
ShopService::valid($shop, $this->merchantId);
|
|
|
$gatheringCode = isset($shop['gatheringCode']) ? $shop['gatheringCode'] : '';
|
|
|
+ if (empty($gatheringCode)) {
|
|
|
+ util::fail('没有收款码');
|
|
|
+ }
|
|
|
$file = dirUtil::getImgDir() . $gatheringCode;
|
|
|
if (file_exists($file) == false) {
|
|
|
util::fail('没有找到收款码');
|
|
|
@@ -44,6 +69,9 @@ class ShopController extends BaseController
|
|
|
$shop = ShopService::getById($id);
|
|
|
ShopService::valid($shop, $this->merchantId);
|
|
|
$applyMemberCode = isset($shop['applyMemberCode']) ? $shop['applyMemberCode'] : '';
|
|
|
+ if (empty($applyMemberCode)) {
|
|
|
+ util::fail('没有注册会员码');
|
|
|
+ }
|
|
|
$file = dirUtil::getImgDir() . $applyMemberCode;
|
|
|
if (file_exists($file) == false) {
|
|
|
util::fail('没有找到注册会员码');
|