更新状态查询

This commit is contained in:
yaooo 2023-09-04 13:12:52 +08:00
parent ccbd53a895
commit 0b7f331877
4 changed files with 8 additions and 4 deletions

View File

@ -620,7 +620,8 @@ class Community extends BaseController
public function entrust()
{
$data = $this->checkParams();
$merchantInfo = Db::name('merchant')->where('mer_id', $data['entrust_mer_id'] ?? 0)->where('type_id', Merchant::TypeSupplyChain)->fetchSql(false)->find();
$typeSupplyChainId = Db::name('MerchantType')->where('type_code', Merchant::TypeCode['TypeSupplyChain'])->value('mer_type_id');
$merchantInfo = Db::name('merchant')->where('mer_id', $data['entrust_mer_id'] ?? 0)->where('type_id', $typeSupplyChainId)->fetchSql(false)->find();
if (!$merchantInfo) {
return app('json')->fail('此商户不支持委托');
}

View File

@ -120,7 +120,8 @@ class StoreProduct extends BaseController
}
$data['mer_status'] = ($merchant['is_del'] || !$merchant['mer_state'] || !$merchant['status']) ? 0 : 1;
$data['mer_id'] = $merId;
$productType = $merchant->type_id == Merchant::TypeSupplyChain ? 98 : 0;
$typeSupplyChainId = Db::name('MerchantType')->where('type_code', Merchant::TypeCode['TypeSupplyChain'])->value('mer_type_id');
$productType = $merchant->type_id == $typeSupplyChainId ? 98 : 0;
$this->repository->edit($id, $data, $merId, $productType, 1);
return app('json')->success('编辑成功');
}

View File

@ -118,7 +118,8 @@ class Product extends BaseController
$data['mer_status'] = ($this->request->merchant()->is_del || !$this->request->merchant()->mer_state || !$this->request->merchant()->status) ? 0 : 1;
$data['mer_id'] = $this->request->merId();
$data['update_time'] = date('Y-m-d H:i:s');
$productType = $this->request->merchant()->type_id == Merchant::TypeSupplyChain ? 98 : 0;
$typeSupplyChainId = Db::name('MerchantType')->where('type_code', Merchant::TypeCode['TypeSupplyChain'])->value('mer_type_id');
$productType = $this->request->merchant()->type_id == $typeSupplyChainId ? 98 : 0;
$this->repository->edit($id, $data, $this->request->merId(), $productType);
return app('json')->success('编辑成功');
}

View File

@ -39,7 +39,8 @@ class ProductCreate
$data['status'] = $cityMerchant['is_audit'] ? 0 : 1;
$data['mer_status'] = ($cityMerchant['is_del'] || !$cityMerchant['mer_state'] || !$cityMerchant['status']) ? 0 : 1;
$data['rate'] = 3;
$productType = $cityMerchant['type_id'] == Merchant::TypeSupplyChain ? 98 : 0;
$typeSupplyChainId = Db::name('MerchantType')->where('type_code', Merchant::TypeCode['TypeSupplyChain'])->value('mer_type_id');
$productType = $cityMerchant['type_id'] == $typeSupplyChainId ? 98 : 0;
$data['update_time'] = date('Y-m-d H:i:s');
app()->make(ProductRepository::class)->create($data, $productType, $contentType);
}