添加:商户支持绑定 资源股东

This commit is contained in:
wuhui_zzw 2024-04-25 17:22:28 +08:00
parent 336db39b0b
commit c288f99456
3 changed files with 19 additions and 7 deletions

View File

@ -18,6 +18,7 @@ use app\common\model\store\service\StoreService;
use app\common\model\system\config\SystemConfigValue;
use app\common\model\system\financial\Financial;
use app\common\model\system\serve\ServeOrder;
use app\common\model\user\User;
use app\common\repositories\store\order\StoreOrderRepository;
use app\common\repositories\store\StoreActivityRepository;
use app\common\repositories\system\merchant\MerchantRepository;
@ -287,10 +288,14 @@ class Merchant extends BaseModel
public function agent(){
return $this->hasOne(Agent::class,'id', 'agent_id')->where('is_del', 0);
}
// 品牌信息
public function brand(){
return $this->hasOne(MerchantBrand::class,'id', 'brand_id');
}
// 资源股东
public function shareholders(){
return $this->hasOne(User::class,'uid', 'resource_shareholders_uid');
}
/**
* Common: 获取本月销售数量

View File

@ -835,11 +835,17 @@ class MerchantRepository extends BaseRepository
* @author Qinii
* @day 2023/7/1
*/
public function adminDetail($id)
{
$data = $this->dao->getWhere(['mer_id' => $id],'*',['merchantType','merchantCategory','merShop'=>function($query){
$query->field('mer_id,mer_name,shop_mer_id');
}])->toArray();
public function adminDetail($id){
$data = $this->dao->getWhere(['mer_id' => $id],'*',[
'shareholders' => function($query){
$query->field('uid,nickname,avatar');
},
'merchantType',
'merchantCategory',
'merShop' => function($query){
$query->field('mer_id,mer_name,shop_mer_id');
}
])->toArray();
$make = app()->make(MerchantAdminRepository::class);
$data['mer_account'] = $make->merIdByAccount($id);
$data['mer_password'] = '***********';

View File

@ -228,7 +228,8 @@ class Merchant extends BaseController
'mer_label',
['merchant_type',0],
'shop_mer_id',
'brand_id'
'brand_id',
['resource_shareholders_uid',0],
]);
$data['mer_label'] = str_replace('',',',$data['mer_label']);
if (!$isUpdate) {