sugar1569 4 lat temu
rodzic
commit
4632595806

+ 1 - 0
crmeb/app/adminapi/common.php

@@ -122,6 +122,7 @@ if (!function_exists('attr_format')) {
                 if ($i == 0) $data = $arr[$i]['detail'];
                 if ($i == 0) $data = $arr[$i]['detail'];
                 //替代变量1
                 //替代变量1
                 $rep1 = [];
                 $rep1 = [];
+                $rep4 = [];
                 foreach ($data as $v) {
                 foreach ($data as $v) {
                     foreach ($arr[$i + 1]['detail'] as $g) {
                     foreach ($arr[$i + 1]['detail'] as $g) {
                         //替代变量2
                         //替代变量2

+ 2 - 2
crmeb/app/api/controller/v1/PublicController.php

@@ -82,7 +82,7 @@ class PublicController
         if ($request->uid()) {
         if ($request->uid()) {
             /** @var WechatUserServices $wechatUserService */
             /** @var WechatUserServices $wechatUserService */
             $wechatUserService = app()->make(WechatUserServices::class);
             $wechatUserService = app()->make(WechatUserServices::class);
-            $subscribe = $wechatUserService->value(['uid' => $request->uid()], 'subscribe') ? true : false;
+            $subscribe = (bool)$wechatUserService->value(['uid' => $request->uid()], 'subscribe');
         } else {
         } else {
             $subscribe = true;
             $subscribe = true;
         }
         }
@@ -137,7 +137,7 @@ class PublicController
         $brokerageFuncStatus = sys_config('brokerage_func_status');
         $brokerageFuncStatus = sys_config('brokerage_func_status');
         $balanceFuncStatus = sys_config('balance_func_status');
         $balanceFuncStatus = sys_config('balance_func_status');
         $vipCard = sys_config('member_card_status', 0);
         $vipCard = sys_config('member_card_status', 0);
-        $svipOpen = sys_config('member_card_status') ? true : false;
+        $svipOpen = (bool)sys_config('member_card_status');
         $userService = $invoiceStatus = $deliveryUser = $isUserPromoter = $userVerifyStatus = $userOrder = true;
         $userService = $invoiceStatus = $deliveryUser = $isUserPromoter = $userVerifyStatus = $userOrder = true;
 
 
         if ($uid && $userInfo) {
         if ($uid && $userInfo) {

+ 3 - 3
crmeb/app/api/controller/v2/PublicController.php

@@ -45,7 +45,7 @@ class PublicController
             $userService->offMemberLevel($request->uid());
             $userService->offMemberLevel($request->uid());
             /** @var WechatUserServices $wechatUserService */
             /** @var WechatUserServices $wechatUserService */
             $wechatUserService = app()->make(WechatUserServices::class);
             $wechatUserService = app()->make(WechatUserServices::class);
-            $subscribe = $wechatUserService->value(['uid' => $request->uid(), 'user_type' => 'wechat'], 'subscribe') ? true : false;
+            $subscribe = (bool)$wechatUserService->value(['uid' => $request->uid(), 'user_type' => 'wechat'], 'subscribe');
         } else {
         } else {
             $subscribe = true;
             $subscribe = true;
         }
         }
@@ -75,7 +75,7 @@ class PublicController
      */
      */
     public function bindPhoneStatus()
     public function bindPhoneStatus()
     {
     {
-        $status = sys_config('store_user_mobile') ? true : false;
+        $status = (bool)sys_config('store_user_mobile');
         return app('json')->success(compact('status'));
         return app('json')->success(compact('status'));
     }
     }
 
 
@@ -87,7 +87,7 @@ class PublicController
      */
      */
     public function subscribe(Request $request, WechatUserServices $services)
     public function subscribe(Request $request, WechatUserServices $services)
     {
     {
-        return app('json')->success(['subscribe' => $services->value(['uid' => $request->uid(), 'user_type' => 'wechat'], 'subscribe') ? true : false]);
+        return app('json')->success(['subscribe' => (bool)$services->value(['uid' => $request->uid(), 'user_type' => 'wechat'], 'subscribe')]);
     }
     }
 
 
     /**
     /**

+ 1 - 1
crmeb/app/common.php

@@ -69,7 +69,7 @@ if (!function_exists('sys_config')) {
             if (strpos($sysConfig, '/uploads/system/') !== false) $sysConfig = set_file_url($sysConfig);
             if (strpos($sysConfig, '/uploads/system/') !== false) $sysConfig = set_file_url($sysConfig);
         }
         }
         $config = is_array($sysConfig) ? $sysConfig : trim($sysConfig);
         $config = is_array($sysConfig) ? $sysConfig : trim($sysConfig);
-        if ($config === '' || $config === false) {
+        if ($config === '' || $config == false) {
             return $default;
             return $default;
         } else {
         } else {
             return $config;
             return $config;

+ 1 - 0
crmeb/app/dao/BaseDao.php

@@ -378,6 +378,7 @@ abstract class BaseDao
             $result = $this->getOne([$keyField => $key]);
             $result = $this->getOne([$keyField => $key]);
         }
         }
         if (!$result) return false;
         if (!$result) return false;
+        $new = 0;
         if ($type === 1) {
         if ($type === 1) {
             $new = bcadd($result[$incField], $inc, $acc);
             $new = bcadd($result[$incField], $inc, $acc);
         } else if ($type === 2) {
         } else if ($type === 2) {

+ 2 - 2
crmeb/app/jobs/OrderJob.php

@@ -192,7 +192,7 @@ class OrderJob extends BaseJobs
             $cartInfoServices = app()->make(StoreOrderCartInfoServices::class);
             $cartInfoServices = app()->make(StoreOrderCartInfoServices::class);
             /** @var SmsSendServices $smsServices */
             /** @var SmsSendServices $smsServices */
             $smsServices = app()->make(SmsSendServices::class);
             $smsServices = app()->make(SmsSendServices::class);
-            $switch = sys_config('admin_pay_success_switch') ? true : false;
+            $switch = (bool)sys_config('admin_pay_success_switch');
             foreach ($serviceOrderNotice as $key => $item) {
             foreach ($serviceOrderNotice as $key => $item) {
                 $admin_name = $item['nickname'];
                 $admin_name = $item['nickname'];
                 $order_id = $order['order_id'];
                 $order_id = $order['order_id'];
@@ -256,7 +256,7 @@ class OrderJob extends BaseJobs
      */
      */
     public function mssageSendPaySuccess($order)
     public function mssageSendPaySuccess($order)
     {
     {
-        $switch = sys_config('lower_order_switch') ? true : false;
+        $switch = (bool)sys_config('lower_order_switch');
         //模板变量
         //模板变量
         $pay_price = $order['pay_price'];
         $pay_price = $order['pay_price'];
         $order_id = $order['order_id'];
         $order_id = $order['order_id'];

+ 1 - 1
crmeb/app/kefuapi/controller/Common.php

@@ -100,7 +100,7 @@ class Common extends BaseController
             $tourist_avatar = sys_config('tourist_avatar');
             $tourist_avatar = sys_config('tourist_avatar');
             $avatar = Arr::getArrayRandKey(is_array($tourist_avatar) ? $tourist_avatar : []);
             $avatar = Arr::getArrayRandKey(is_array($tourist_avatar) ? $tourist_avatar : []);
             $userInfo['tourist_avatar'] = $uid ? '' : $avatar;
             $userInfo['tourist_avatar'] = $uid ? '' : $avatar;
-            $userInfo['is_tourist'] = $tourist_uid ? true : false;
+            $userInfo['is_tourist'] = (bool)$tourist_uid;
             return app('json')->success($userInfo->toArray());
             return app('json')->success($userInfo->toArray());
         } else {
         } else {
             return app('json')->fail('暂无客服人员');
             return app('json')->fail('暂无客服人员');

+ 1 - 1
crmeb/app/services/message/NoticeService.php

@@ -103,7 +103,7 @@ class NoticeService extends BaseServices
             'partner' => sys_config('develop_id', ''),
             'partner' => sys_config('develop_id', ''),
             'terminal' => sys_config('terminal_number', '')
             'terminal' => sys_config('terminal_number', '')
         ];
         ];
-        $switch = sys_config('pay_success_printing_switch') ? true : false;
+        $switch = (bool)sys_config('pay_success_printing_switch');
         if (!$switch) {
         if (!$switch) {
             throw new ValidateException('小票打印未开启!');
             throw new ValidateException('小票打印未开启!');
         }
         }

+ 1 - 1
crmeb/app/services/message/notice/EnterpriseWechatService.php

@@ -38,7 +38,7 @@ class EnterpriseWechatService extends NoticeService
      */
      */
     public function isOpen(string $mark)
     public function isOpen(string $mark)
     {
     {
-        $this->isopend = ($this->notceinfo['is_ent_wechat'] == 1 && $this->notceinfo['url'] !== '')  ? true : false;
+        $this->isopend = $this->notceinfo['is_ent_wechat'] == 1 && $this->notceinfo['url'] !== '';
         return $this;
         return $this;
 
 
     }
     }

+ 2 - 2
crmeb/app/services/message/notice/NoticeSmsService.php

@@ -39,7 +39,7 @@ class NoticeSmsService extends NoticeService
      */
      */
     public function isOpen(string $mark)
     public function isOpen(string $mark)
     {
     {
-        $this->isopend = $this->notceinfo['is_sms'] === 1 ? true : false;
+        $this->isopend = $this->notceinfo['is_sms'] === 1;
         return $this;
         return $this;
 
 
     }
     }
@@ -57,7 +57,7 @@ class NoticeSmsService extends NoticeService
     public function sendSms($phone, array $data, string $template)
     public function sendSms($phone, array $data, string $template)
     {
     {
         try {
         try {
-            $this->isopend = $this->notceinfo['is_sms'] === 1 ? true : false;
+            $this->isopend = $this->notceinfo['is_sms'] === 1;
             if ($this->isopend) {
             if ($this->isopend) {
                 SmsJob::dispatch('doJob', [$phone, $data, $template]);
                 SmsJob::dispatch('doJob', [$phone, $data, $template]);
             }
             }

+ 1 - 1
crmeb/app/services/order/DeliveryServiceServices.php

@@ -148,6 +148,6 @@ class DeliveryServiceServices extends BaseServices
      */
      */
     public function checkoutIsService(int $uid)
     public function checkoutIsService(int $uid)
     {
     {
-        return $this->dao->count(['uid' => $uid, 'status' => 1]) ? true : false;
+        return (bool)$this->dao->count(['uid' => $uid, 'status' => 1]);
     }
     }
 }
 }

+ 1 - 1
crmeb/app/services/product/product/CopyTaobaoServices.php

@@ -562,6 +562,6 @@ class CopyTaobaoServices extends BaseServices
      */
      */
     public function createSpu()
     public function createSpu()
     {
     {
-        return substr(implode(NULL, array_map('ord', str_split(substr(uniqid(), 7, 13), 1))), 0, 8) . str_pad((string)mt_rand(1, 99999), 5, '0', STR_PAD_LEFT);
+        return substr(implode('NULL', array_map('ord', str_split(substr(uniqid(), 7, 13), 1))), 0, 8) . str_pad((string)mt_rand(1, 99999), 5, '0', STR_PAD_LEFT);
     }
     }
 }
 }

+ 1 - 1
crmeb/app/services/system/attachment/SystemAttachmentCategoryServices.php

@@ -106,7 +106,7 @@ class SystemAttachmentCategoryServices extends BaseServices
     public function form($info = [])
     public function form($info = [])
     {
     {
         return [
         return [
-            Form::select('pid', '上级分类', (int)($info['pid'] ?? ''))->setOptions($this->getCateList(['pid' => 0]))->filterable(1),
+            Form::select('pid', '上级分类', (int)($info['pid'] ?? ''))->setOptions($this->getCateList(['pid' => 0]))->filterable(true),
             Form::input('name', '分类名称', $info['name'] ?? '')->maxlength(30),
             Form::input('name', '分类名称', $info['name'] ?? '')->maxlength(30),
         ];
         ];
     }
     }

+ 1 - 1
crmeb/app/services/user/UserRechargeServices.php

@@ -274,7 +274,7 @@ class UserRechargeServices extends BaseServices
      */
      */
     public function getOrderId()
     public function getOrderId()
     {
     {
-        return 'wx' . date('YmdHis', time()) . substr(implode(NULL, array_map('ord', str_split(substr(uniqid(), 7, 13), 1))), 0, 8);
+        return 'wx' . date('YmdHis', time()) . substr(implode('NULL', array_map('ord', str_split(substr(uniqid(), 7, 13), 1))), 0, 8);
     }
     }
 
 
     /**
     /**

+ 1 - 1
crmeb/crmeb/services/FileService.php

@@ -541,7 +541,7 @@ class FileService
             $content = file_get_contents($path);
             $content = file_get_contents($path);
             $content = string::chang_code($content, $input_code, $out_code);
             $content = string::chang_code($content, $input_code, $out_code);
             $fp = fopen($path, 'w');
             $fp = fopen($path, 'w');
-            return fputs($fp, $content) ? TRUE : FALSE;
+            return (bool)fputs($fp, $content);
             fclose($fp);
             fclose($fp);
         }
         }
     }
     }

+ 1 - 1
crmeb/crmeb/traits/CurdControllerTrait.php

@@ -60,7 +60,7 @@ trait CurdControllerTrait
         foreach ($data as $key => $value) {
         foreach ($data as $key => $value) {
             $modelData->{$key} = $value;
             $modelData->{$key} = $value;
         }
         }
-        return $modelData->save() ? true : $this->setErrorInfo('保存失败');
+        return $modelData->save() || $this->setErrorInfo('保存失败');
     }
     }
 
 
     /**
     /**

+ 1 - 0
crmeb/crmeb/utils/Canvas.php

@@ -156,6 +156,7 @@ class Canvas
         $file = str_replace('https', 'http', $file);
         $file = str_replace('https', 'http', $file);
         $imagesize = getimagesize($file);
         $imagesize = getimagesize($file);
         $type = image_type_to_extension($imagesize[2], true);
         $type = image_type_to_extension($imagesize[2], true);
+        $canvas = null;
         switch ($type) {
         switch ($type) {
             case '.png':
             case '.png':
                 $canvas = imagecreatefrompng($file);
                 $canvas = imagecreatefrompng($file);

+ 1 - 1
crmeb/public/install/index.php

@@ -270,7 +270,7 @@ switch ($step) {
     case '4':
     case '4':
         if (intval($_GET['install'])) {
         if (intval($_GET['install'])) {
             $n = intval($_GET['n']);
             $n = intval($_GET['n']);
-            if ($i == 999999)
+            if ($n == 999999)
                 exit;
                 exit;
             $arr = array();
             $arr = array();