|
@@ -16,6 +16,8 @@ use JinDouYun\Dao\Department\DStaff;
|
|
|
use JinDouYun\Dao\GoodsManage\DGoodsBasic;
|
|
|
use JinDouYun\Dao\UserCenter\DUserCenter;
|
|
|
use JinDouYun\Model\Common\Location;
|
|
|
+use JinDouYun\Model\Customer\MMemberBalanceDetail;
|
|
|
+use JinDouYun\Model\System\MBasicSetup;
|
|
|
use Mall\Framework\Core\ErrorCode;
|
|
|
use Mall\Framework\Core\StatusCode;
|
|
|
use Mall\Framework\Core\ResultWrapper;
|
|
@@ -53,6 +55,7 @@ class MShop extends MBaseModel
|
|
|
private $objShopCache;
|
|
|
private $objMEnterprise;
|
|
|
private $objMStaff;
|
|
|
+ private $objMMemberBalanceDetail;
|
|
|
|
|
|
public function __construct($enterpriseId, $userCenterId = '')
|
|
|
{
|
|
@@ -67,6 +70,7 @@ class MShop extends MBaseModel
|
|
|
$this->objShopCache = new ShopCache();
|
|
|
$this->objMEnterprise = new MEnterprise();
|
|
|
$this->objMStaff = new MStaff($enterpriseId,$userCenterId);
|
|
|
+ $this->objMMemberBalanceDetail = new MMemberBalanceDetail($enterpriseId,$userCenterId);
|
|
|
|
|
|
$tableName = $this->objDShop->getTableName('qianniao_shop', $this->enterpriseId, $this->cutTable);
|
|
|
$this->objDShop->setTable($tableName);
|
|
@@ -142,6 +146,29 @@ class MShop extends MBaseModel
|
|
|
$this->objDShop->rollBack();
|
|
|
return ResultWrapper::fail($this->objDEnterpriseBindShop->error(),ErrorCode::$dberror);
|
|
|
}
|
|
|
+ if($params['recommend_user_id']>0)
|
|
|
+ {
|
|
|
+ $objMBasicSetup = new MBasicSetup($this->enterpriseId);
|
|
|
+ $memberBalanceDetailData = [
|
|
|
+ 'customerId' => $params['customerId'],
|
|
|
+ 'type' => 5,
|
|
|
+ 'userCenterId' => $params['recommend_user_id'],
|
|
|
+ 'money' => $objMBasicSetup->getBasicField('yhtjmd')->getData(),
|
|
|
+ 'purpose' => '推荐门店获得',
|
|
|
+ 'orderIds' =>'',
|
|
|
+ 'remark' => '推荐门店获得'.$objMBasicSetup->getBasicField('yhtjmd')->getData(),
|
|
|
+ 'financeType' => '推荐门店获得',
|
|
|
+ 'accountId' => isset($params['accountId']) ? $params['accountId']: 0,
|
|
|
+ 'accountName' => isset($params['accountName']) ? $params['accountName']: '',
|
|
|
+ 'accountNumber' => isset($params['accountNumber']) ? $params['accountNumber']: '',
|
|
|
+ 'explain' => isset($params['explain']) ? $params['explain']: '',
|
|
|
+ ];
|
|
|
+ $result = $this->objMMemberBalanceDetail->addMemberBalanceDetail($memberBalanceDetailData,$isbackstage=true);
|
|
|
+ if($result) {
|
|
|
+ $this->objDShop > update(['is_send' => 1], ['id' => $ShopId]);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
/*//自动创建仓库
|
|
|
$wareHouseParam = [
|