更新状态查询
This commit is contained in:
parent
ccbd53a895
commit
0b7f331877
@ -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('此商户不支持委托');
|
||||
}
|
||||
|
@ -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('编辑成功');
|
||||
}
|
||||
|
@ -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('编辑成功');
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user