头像
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
namespace app\common\controller;
|
||||
|
||||
use app\common\controller\BaseController;
|
||||
use app\common\service\OssService;
|
||||
use app\common\traits\crud\CrudControllerTrait;
|
||||
use app\common\service\UserService;
|
||||
use support\Request;
|
||||
@@ -85,6 +86,12 @@ class UserController extends BaseController
|
||||
$data['updated_at'] = date('Y-m-d H:i:s', $data['updated_at']);
|
||||
unset($data['union_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;
|
||||
}
|
||||
}
|
||||
@@ -218,6 +218,7 @@ class AuthLogic
|
||||
}
|
||||
|
||||
|
||||
Log::info('userInfo:' ,[$userInfo]);
|
||||
User::firstOrCreate(['union_id'=>$userInfo['data']['union_id']],[
|
||||
'union_id'=>$userInfo['data']['union_id'],
|
||||
'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>
|
||||
<div class="image-list">
|
||||
<?php foreach ($car['images'] as $img): ?>
|
||||
<div class="image-item">
|
||||
<img src="<?= $img ?>">
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
<table width="100%" cellpadding="6" cellspacing="0">
|
||||
<tr>
|
||||
<?php foreach ($car['images'] as $i => $img): ?>
|
||||
<td width="50%" align="center">
|
||||
<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>
|
||||
|
||||
</body>
|
||||
|
||||
Reference in New Issue
Block a user