mirror of
https://github.com/crmeb/CRMEB.git
synced 2026-11-01 07:20:56 +00:00
优化代码
This commit is contained in:
parent
dfc7aa1685
commit
3514322969
@ -2,7 +2,7 @@
|
||||
// +----------------------------------------------------------------------
|
||||
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2016~2020 https://www.crmeb.com All rights reserved.
|
||||
// | Copyright (c) 2016~2021 https://www.crmeb.com All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
@ -62,6 +62,7 @@ class StoreOrderController
|
||||
*/
|
||||
protected $getChennel = [
|
||||
'weixin' => 0,
|
||||
'routine' => 1,
|
||||
'weixinh5' => 2,
|
||||
'pc' => 3
|
||||
];
|
||||
|
||||
@ -816,7 +816,6 @@ if (!function_exists('get_image_thumb')) {
|
||||
$image = $type == 'all' ? $data : $data[$type] ?? $filePath;
|
||||
} catch (\Throwable $e) {
|
||||
$image = $filePath;
|
||||
// throw new ValidateException($e->getMessage());
|
||||
\think\facade\Log::error('获取缩略图失败,原因:' . $e->getMessage() . '----' . $e->getFile() . '----' . $e->getLine() . '----' . $filePath);
|
||||
}
|
||||
$data = parse_url($image);
|
||||
|
||||
@ -192,9 +192,6 @@ class UserWechatUserDao extends BaseDao
|
||||
case "nickname":
|
||||
case "phone":
|
||||
$model = $model->where($userAlias . trim($fieldKey), 'like', "%" . trim($nickname) . "%");
|
||||
// break;
|
||||
// case "phone":
|
||||
// $model = $model->where($userAlias . trim($fieldKey), 'like', "%" . trim($nickname) . "%");
|
||||
break;
|
||||
case "uid":
|
||||
$model = $model->where($userAlias . trim($fieldKey), trim($nickname));
|
||||
|
||||
@ -103,7 +103,7 @@ class LoginServices extends BaseServices
|
||||
if ($spreadUid) {
|
||||
$spreadUid = (int)$spreadUid;
|
||||
$data['spread_uid'] = $spreadUid;
|
||||
$data['spread_time'] = $userInfo->last_time;
|
||||
$data['spread_time'] = time();
|
||||
$this->dao->incField($spreadUid, 'spread_count', 1);
|
||||
//绑定用户后置事件
|
||||
event('user.register', [$spreadUid, $userInfo['user_type'], $userInfo['nickname'], $userInfo['uid'], 0]);
|
||||
|
||||
@ -165,18 +165,17 @@ class UserAddressServices extends BaseServices
|
||||
public function editAddress(int $uid, array $addressInfo)
|
||||
{
|
||||
if ($addressInfo['id'] == 0) {
|
||||
$where = [
|
||||
['uid', '=', $uid],
|
||||
['real_name', '=', $addressInfo['real_name']],
|
||||
['phone', '=', $addressInfo['phone']],
|
||||
['detail', '=', $addressInfo['detail']],
|
||||
['is_del', '=', 0]
|
||||
];
|
||||
if (isset($addressInfo['address']['city_id'])) {
|
||||
$where[] = ['city_id', '=', $addressInfo['address']['city_id']];
|
||||
} else {
|
||||
$where = [];
|
||||
$where += ['city_id', '=', $addressInfo['address']['city_id']];
|
||||
}
|
||||
$res = $this->dao->getCount([
|
||||
['uid', '=', $uid],
|
||||
['real_name', '=', $addressInfo['real_name']],
|
||||
['phone', '=', $addressInfo['phone']],
|
||||
['detail', '=', $addressInfo['detail']],
|
||||
['is_del', '=', 0]
|
||||
] + $where);
|
||||
$res = $this->dao->getCount($where);
|
||||
if ($res) throw new ValidateException('地址已存在,请勿重复添加');
|
||||
}
|
||||
|
||||
|
||||
@ -1530,7 +1530,7 @@ class UserServices extends BaseServices
|
||||
{
|
||||
switch ($data['type']) {
|
||||
case 'week':
|
||||
$startTime = strtotime('this week');
|
||||
$startTime = strtotime('this week Monday');
|
||||
$endTime = time();
|
||||
break;
|
||||
case 'month':
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user