lqmac 10 months ago
parent 4a3d59beef
commit bcfab48a6f
  1. 7
      app/common/model/MerchantGoodsCate.php
  2. 13
      app/store/controller/Merchant.php
  3. 1
      config/allowapi.php

@ -33,8 +33,11 @@ class MerchantGoodsCate extends BaseModel
* @param int $helpId
* @return static|array|null
*/
public static function detail(int $helpId)
public static function detail(int $merchantId)
{
return self::get($helpId);
$where = [
'merchant_id' => $merchantId,
];
return static::get($where, []);
}
}

@ -22,6 +22,7 @@ use app\store\model\store\User as StoreUserModel;
use app\store\model\store\Role as role;
use app\common\model\store\UserRole as UserRoleModel;
use app\common\model\MerchantGoodsCate;
use think\Db;
/**
* 商户ID、商店ID 隔离商城里面的商户
* Class Store
@ -182,12 +183,22 @@ class Merchant extends Controller
$merchantId = $this->merchantId;
}
public function getMerchantGoodsCate(): Json{
$merchantId = $this->merchantId;
$merchant = MerchantGoodsCate::detail($merchantId);
//var_dump($merchant);
return $this->renderSuccess(compact("merchant"));
}
public function addMerchant(): Json
{
$data = $this->postForm();
$data = json_decode($data);
$Merchant = MerchantGoodsCate::where($this->storeId)->find()->toArray();
return $this->renderSuccess($Merchant);
}

@ -6,4 +6,5 @@
"/goods/export",
"/goods/collector",
"/goods/import",
"/merchant/getMerchantGoodsCate",
];
Loading…
Cancel
Save