头像
This commit is contained in:
@@ -2,6 +2,7 @@
|
|||||||
namespace app\common\controller;
|
namespace app\common\controller;
|
||||||
|
|
||||||
use app\common\controller\BaseController;
|
use app\common\controller\BaseController;
|
||||||
|
use app\common\service\OssService;
|
||||||
use app\common\traits\crud\CrudControllerTrait;
|
use app\common\traits\crud\CrudControllerTrait;
|
||||||
use app\common\service\UserService;
|
use app\common\service\UserService;
|
||||||
use support\Request;
|
use support\Request;
|
||||||
@@ -85,6 +86,12 @@ class UserController extends BaseController
|
|||||||
$data['updated_at'] = date('Y-m-d H:i:s', $data['updated_at']);
|
$data['updated_at'] = date('Y-m-d H:i:s', $data['updated_at']);
|
||||||
unset($data['union_id']);
|
unset($data['union_id']);
|
||||||
unset($data['app_id']);
|
unset($data['app_id']);
|
||||||
|
|
||||||
|
$ossservice = new OssService();
|
||||||
|
$data['user']['avatar_pull'] = $data['user']['avatar'];
|
||||||
|
if(!str_contains($data['user']['avatar'], 'http') && !empty($data['user']['avatar'])){
|
||||||
|
$data['user']['avatar_pull'] = $ossservice->generatePrivateUrl($data['user']['avatar']);
|
||||||
|
}
|
||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -218,6 +218,7 @@ class AuthLogic
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Log::info('userInfo:' ,[$userInfo]);
|
||||||
User::firstOrCreate(['union_id'=>$userInfo['data']['union_id']],[
|
User::firstOrCreate(['union_id'=>$userInfo['data']['union_id']],[
|
||||||
'union_id'=>$userInfo['data']['union_id'],
|
'union_id'=>$userInfo['data']['union_id'],
|
||||||
'name'=>$userInfo['data']['name'],
|
'name'=>$userInfo['data']['name'],
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ class User extends Model
|
|||||||
/**
|
/**
|
||||||
* 允许自动填充模型字段
|
* 允许自动填充模型字段
|
||||||
*/
|
*/
|
||||||
protected $fillable = ['id', 'union_id', 'app_id', 'name', 'phone', 'email', 'whatsapp', 'social', 'social_code'];
|
protected $fillable = ['id', 'union_id', 'app_id', 'name', 'avatar', 'phone', 'email', 'whatsapp', 'social', 'social_code'];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 不允许自动填充模型字段
|
* 不允许自动填充模型字段
|
||||||
|
|||||||
@@ -110,11 +110,20 @@
|
|||||||
|
|
||||||
<h2>产品图</h2>
|
<h2>产品图</h2>
|
||||||
<div class="image-list">
|
<div class="image-list">
|
||||||
<?php foreach ($car['images'] as $img): ?>
|
<table width="100%" cellpadding="6" cellspacing="0">
|
||||||
<div class="image-item">
|
<tr>
|
||||||
<img src="<?= $img ?>">
|
<?php foreach ($car['images'] as $i => $img): ?>
|
||||||
</div>
|
<td width="50%" align="center">
|
||||||
<?php endforeach; ?>
|
<img src="<?= $img ?>" style="width:100%; border-radius:4px;">
|
||||||
|
</td>
|
||||||
|
|
||||||
|
<?php if (($i + 1) % 2 === 0): ?>
|
||||||
|
</tr><tr>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
Reference in New Issue
Block a user