Merge remote-tracking branch 'shop/dev' into dev
This commit is contained in:
commit
df54963b96
2
.gitignore
vendored
2
.gitignore
vendored
@ -9,4 +9,4 @@ public/static/download/*
|
|||||||
public/phpExcel/*
|
public/phpExcel/*
|
||||||
app/controller/api/Test.php
|
app/controller/api/Test.php
|
||||||
public/protocol.html
|
public/protocol.html
|
||||||
/runtime
|
/runtime/*
|
||||||
|
@ -139,7 +139,7 @@ class StoreCartDao extends BaseDao
|
|||||||
*/
|
*/
|
||||||
public function getCartCount(int $uid,$product_type)
|
public function getCartCount(int $uid,$product_type)
|
||||||
{
|
{
|
||||||
$data = ($this->getModel()::getDB())->where(['uid' => $uid, 'is_del' => 0, 'is_new' => 0, 'is_pay' => 0,'product_type' => $product_type])->field('SUM(cart_num) as count')->select();
|
$data = ($this->getModel()::getDB())->where(['uid' => $uid, 'is_del' => 0, 'is_new' => 0, 'is_pay' => 0,'product_type' => $product_type])->field('count(*) as count')->select();
|
||||||
$data[0]['count'] = $data[0]['count'] ? $data[0]['count'] : 0;
|
$data[0]['count'] = $data[0]['count'] ? $data[0]['count'] : 0;
|
||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
|
@ -246,7 +246,11 @@ class Merchant extends BaseModel
|
|||||||
|
|
||||||
public function getIssetCertificateAttr()
|
public function getIssetCertificateAttr()
|
||||||
{
|
{
|
||||||
return count(merchantConfig($this->mer_id, 'mer_certificate') ?: []) > 0;
|
$merchantCertificate = merchantConfig($this->mer_id, 'mer_certificate');
|
||||||
|
if (!is_array($merchantCertificate)) {
|
||||||
|
$merchantCertificate = empty($merchantCertificate) ? [] : explode(',', $merchantCertificate);
|
||||||
|
}
|
||||||
|
return count($merchantCertificate) > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function searchMerIdsAttr($query, $value)
|
public function searchMerIdsAttr($query, $value)
|
||||||
|
@ -1555,8 +1555,16 @@ class ProductRepository extends BaseRepository
|
|||||||
throw new ValidateException('商品正在参与预售活动');
|
throw new ValidateException('商品正在参与预售活动');
|
||||||
if ($status == 1 && $product['product_type'] == 3)
|
if ($status == 1 && $product['product_type'] == 3)
|
||||||
throw new ValidateException('商品正在参与助力活动');
|
throw new ValidateException('商品正在参与助力活动');
|
||||||
$this->dao->update($id,[$field => $status]);
|
Db::startTrans();
|
||||||
app()->make(SpuRepository::class)->changeStatus($id,$product->product_type);
|
if ($this->dao->update($id, [$field => $status]) === false) {
|
||||||
|
Db::rollback();
|
||||||
|
throw new ValidateException('商品更新出错');
|
||||||
|
}
|
||||||
|
if (app()->make(SpuRepository::class)->changeStatus($id, $product->product_type) === false) {
|
||||||
|
Db::rollback();
|
||||||
|
throw new ValidateException('商品spu更新出错');
|
||||||
|
}
|
||||||
|
Db::commit();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function batchSwitchShow($id, $status, $field, $merId = 0)
|
public function batchSwitchShow($id, $status, $field, $merId = 0)
|
||||||
|
@ -289,8 +289,10 @@ class SpuRepository extends BaseRepository
|
|||||||
Queue(SendSmsJob::class, ['tempId' => 'PRODUCT_INCREASE', 'id' => $id]);
|
Queue(SendSmsJob::class, ['tempId' => 'PRODUCT_INCREASE', 'id' => $id]);
|
||||||
}
|
}
|
||||||
if (in_array($productType, [0, 98])) Queue::push(SyncProductTopJob::class,[]);
|
if (in_array($productType, [0, 98])) Queue::push(SyncProductTopJob::class,[]);
|
||||||
|
return true;
|
||||||
} catch (\Exception $exception) {
|
} catch (\Exception $exception) {
|
||||||
Log::info($exception->getMessage());
|
Log::info($exception->getMessage());
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -120,6 +120,7 @@ class MerchantIntentionRepository extends BaseRepository
|
|||||||
'mer_name' => $intention['mer_name'],
|
'mer_name' => $intention['mer_name'],
|
||||||
'mer_phone' => $intention['phone'],
|
'mer_phone' => $intention['phone'],
|
||||||
'mer_account' => $intention['phone'],
|
'mer_account' => $intention['phone'],
|
||||||
|
'mer_state' => 1, //审核通过自动开启
|
||||||
'category_id' => $intention['merchant_category_id'],
|
'category_id' => $intention['merchant_category_id'],
|
||||||
'type_id' => $intention['mer_type_id'],
|
'type_id' => $intention['mer_type_id'],
|
||||||
'real_name' => $intention['name'],
|
'real_name' => $intention['name'],
|
||||||
|
@ -147,6 +147,9 @@ class Merchant extends BaseController
|
|||||||
$delivery = $repository->get($this->request->merId()) + systemConfig(['tx_map_key']);
|
$delivery = $repository->get($this->request->merId()) + systemConfig(['tx_map_key']);
|
||||||
$data = array_merge($data,$delivery);
|
$data = array_merge($data,$delivery);
|
||||||
$data['sys_bases_status'] = systemConfig('sys_bases_status') === '0' ? 0 : 1;
|
$data['sys_bases_status'] = systemConfig('sys_bases_status') === '0' ? 0 : 1;
|
||||||
|
if (!empty($data['mer_certificate']) && !is_array($data['mer_certificate'])) {
|
||||||
|
$data['mer_certificate'] = explode(',', $data['mer_certificate']);
|
||||||
|
}
|
||||||
|
|
||||||
return app('json')->success($data);
|
return app('json')->success($data);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user