Commit 9c12956e authored by jianghaiming's avatar jianghaiming

update:set

parent 0d55d1b9
......@@ -20,5 +20,7 @@ class ShopException extends BaseException
6 => '门店名称已存在',
7 => '手机号已存在',
8 => '门店名称不能大于20个字',
9 => '门店id不能为空',
10 => '门店修改失败',
];
}
\ No newline at end of file
......@@ -145,7 +145,12 @@ class ShopService
$latitude = !empty($params['latitude']) ? $params['latitude'] : '';
$address = !empty($params['address']) ? $params['address'] : '';
$phone = !empty($params['phone']) ? $params['phone'] : '';
$subShopId = !empty($params['sub_shop_id']) ? $params['sub_shop_id'] : '';
if (empty($subShopId)) {
throw new ShopException(['cus' => 9]);
}
$colums = [];
if (!empty($name)) {
$detectParams = [
'businessId' => 1,
......@@ -156,7 +161,7 @@ class ShopService
if (!empty($sensitive['data'])) {
throw new ShopException(['cus' => 4]);
}
$colums['name'] = $name;
$colums['shop_name'] = $name;
}
$subShopInfo = SubShop::getRecord(['shop_name' => $name]);
......@@ -182,8 +187,10 @@ class ShopService
if (!empty($phone)) {
$colums['phone'] = $phone;
}
$subShop = SubShop::updateRecord($colums, $where);
if (empty($subShop)) {
throw new ShopException(['cus' => 6]);
}
return $subShop;
}
......
<?php
namespace Api\PhpServices\PG;
class GetImage
{
public static function getCoupon(){
//创建画布
$im = imagecreatetruecolor(500, 600);
$qr = new QR('abc');
$qr_img = $qr->get();
list($code_w,$code_h) = getimagesizefromstring($qr_img);
$codeImg = imagecreatefromstring($qr_img);
imagecopyresized($im, $codeImg, 0, 0, 0, 0, 170, 170, $code_w, $code_h);
Header("Content-Type: image/png");
imagepng ($im);
imagedestroy($im);
}
public static function getLeaderShare(){
}
public static function getGoods(){
}
}
\ No newline at end of file
This diff is collapsed.
<?php
namespace Api\PhpServices\PG;
namespace Api\PhpServices\ShopImage;
use Endroid\QrCode\ErrorCorrectionLevel;
use Endroid\QrCode\QrCode;
class QR
......@@ -11,6 +12,14 @@ class QR
private $_logo_url = '';
private $_logo_size = 80;
private $_writeFile = false;
private $_blockSize = QrCode::ROUND_BLOCK_SIZE_MODE_MARGIN;
// private $_errorCorrectionLevel;
public function setRoundBlockSize($_blockSize)
{
$this->_blockSize = $_blockSize;
}
public function setWriteFile(bool $writeFile): void
......@@ -46,6 +55,7 @@ class QR
public function get(){
$qr = new QrCode($this->_content);
$qr->setSize($this->_size);
$qr->setRoundBlockSize(true, $this->_blockSize);
if(!empty($this->_logo_url)){
$qr->setLogoPath($this->_logo_url);
......
......@@ -66,7 +66,7 @@ class MonUtil{
if (empty($module)) {
//默认取url 中的域名作为module
$domain = $_SERVER['SERVER_NAME'] ?? 'unknow_domain';
$module = $domain.($request_module ?? 'other_depent');
$module = $domain.'.'.($request_module ?? 'other_depent');
}
//接口返回状态码打点
......@@ -78,7 +78,7 @@ class MonUtil{
//接口请求响应总时间打点
if(!empty($request_time) && is_numeric($request_time) && $request_time != -899){
$result .= self::timing((string)$request_uri, "TotalTime", $request_time);
$result .= self::timing($module.'.'.(string)$request_uri, "TotalTime", $request_time);
}
}
return $result;
......@@ -107,7 +107,12 @@ class MonUtil{
//耗时打点
if(!empty($request_time) && is_numeric($request_time) && $request_time != -799){
$result = self::timing(($db_name.'.'.$host.$operator), "TotalTime", $request_time,'s');
$type = 'ms';
if ($request_time < 1) {
$request_time *= 1000;
$type = 's';
}
$result = self::timing(($db_name.'.'.$host.'.'.$operator), "TotalTime", $request_time,$type);
}
}
......
......@@ -32,7 +32,7 @@ private static $installed = array (
'aliases' =>
array (
),
'reference' => '48662ee0ac551270f90d09cda3f0a1ab5d45c556',
'reference' => '0d55d1b988fb0ef7b715037568463cf4b8fa5e88',
'name' => 'yidian/yaf_demo',
),
'versions' =>
......@@ -45,7 +45,7 @@ private static $installed = array (
array (
0 => '9999999-dev',
),
'reference' => '3a118172e1f4bb413ccbef92c037f4f3255b388a',
'reference' => 'd12158b756ba1aee7d019a8d25ca79f49bbe1d8c',
),
'api/php_utils' =>
array (
......@@ -55,7 +55,7 @@ private static $installed = array (
array (
0 => '9999999-dev',
),
'reference' => '16949fb782de0488cf192e3cd9d4e1268377294d',
'reference' => 'a6fdc2ddaf55ca6f8f86a3295b7659a70c50b2ec',
),
'bacon/bacon-qr-code' =>
array (
......@@ -326,7 +326,7 @@ private static $installed = array (
'aliases' =>
array (
),
'reference' => '92855c727d7edabe004605f451ef0b274fa24490',
'reference' => 'c29a3e649843f4a34eaa4be2683f4914e8b7f023',
),
'yidian/yaf_demo' =>
array (
......@@ -335,7 +335,7 @@ private static $installed = array (
'aliases' =>
array (
),
'reference' => '48662ee0ac551270f90d09cda3f0a1ab5d45c556',
'reference' => '0d55d1b988fb0ef7b715037568463cf4b8fa5e88',
),
),
);
......
......@@ -21,8 +21,6 @@ return array(
'Api\\PhpServices\\Ksy\\Ksyun' => $vendorDir . '/api/php_services/src/Ksy/Ksyun.php',
'Api\\PhpServices\\LifeAccount\\Account' => $vendorDir . '/api/php_services/src/LifeAccount/Account.php',
'Api\\PhpServices\\Login\\Login' => $vendorDir . '/api/php_services/src/Login/Login.php',
'Api\\PhpServices\\PG\\GetImage' => $vendorDir . '/api/php_services/src/PG/GetImage.php',
'Api\\PhpServices\\PG\\QR' => $vendorDir . '/api/php_services/src/PG/QR.php',
'Api\\PhpServices\\PushToken\\Android' => $vendorDir . '/api/php_services/src/PushToken/Android.php',
'Api\\PhpServices\\PushToken\\Base' => $vendorDir . '/api/php_services/src/PushToken/Base.php',
'Api\\PhpServices\\PushToken\\Ios' => $vendorDir . '/api/php_services/src/PushToken/Ios.php',
......@@ -31,6 +29,8 @@ return array(
'Api\\PhpServices\\Session\\RedisSessionHandler' => $vendorDir . '/api/php_services/src/Session/RedisSessionHandler.php',
'Api\\PhpServices\\Session\\Session' => $vendorDir . '/api/php_services/src/Session/Session.php',
'Api\\PhpServices\\Session\\SessionManager' => $vendorDir . '/api/php_services/src/Session/SessionManager.php',
'Api\\PhpServices\\ShopImage\\GetImage' => $vendorDir . '/api/php_services/src/ShopImage/GetImage.php',
'Api\\PhpServices\\ShopImage\\QR' => $vendorDir . '/api/php_services/src/ShopImage/QR.php',
'Api\\PhpServices\\Towerpro\\Towerpro' => $vendorDir . '/api/php_services/src/Towerpro/Towerpro.php',
'Api\\PhpServices\\Tuffy\\TuffyService' => $vendorDir . '/api/php_services/src/Tuffy/TuffyService.php',
'Api\\PhpServices\\XhProfiler\\XhMongo' => $vendorDir . '/api/php_services/src/XhProfiler/XhMongo.php',
......@@ -107,6 +107,7 @@ return array(
'App\\Models\\shop\\mysql\\Shop' => $baseDir . '/application/models/shop/mysql/Shop.php',
'App\\Models\\shop\\mysql\\SubShop' => $baseDir . '/application/models/shop/mysql/SubShop.php',
'App\\Plugins\\Hook' => $baseDir . '/application/plugins/Hook.php',
'App\\Services\\common\\CommonService' => $baseDir . '/application/services/common/CommonService.php',
'App\\Services\\demo\\ElasticService' => $baseDir . '/application/services/demo/ElasticService.php',
'App\\Services\\demo\\MongoService' => $baseDir . '/application/services/demo/MongoService.php',
'App\\Services\\demo\\MysqlService' => $baseDir . '/application/services/demo/MysqlService.php',
......
......@@ -250,8 +250,6 @@ class ComposerStaticInit48fd9e88279ffd9162a19bdedd5d5a0a
'Api\\PhpServices\\Ksy\\Ksyun' => __DIR__ . '/..' . '/api/php_services/src/Ksy/Ksyun.php',
'Api\\PhpServices\\LifeAccount\\Account' => __DIR__ . '/..' . '/api/php_services/src/LifeAccount/Account.php',
'Api\\PhpServices\\Login\\Login' => __DIR__ . '/..' . '/api/php_services/src/Login/Login.php',
'Api\\PhpServices\\PG\\GetImage' => __DIR__ . '/..' . '/api/php_services/src/PG/GetImage.php',
'Api\\PhpServices\\PG\\QR' => __DIR__ . '/..' . '/api/php_services/src/PG/QR.php',
'Api\\PhpServices\\PushToken\\Android' => __DIR__ . '/..' . '/api/php_services/src/PushToken/Android.php',
'Api\\PhpServices\\PushToken\\Base' => __DIR__ . '/..' . '/api/php_services/src/PushToken/Base.php',
'Api\\PhpServices\\PushToken\\Ios' => __DIR__ . '/..' . '/api/php_services/src/PushToken/Ios.php',
......@@ -260,6 +258,8 @@ class ComposerStaticInit48fd9e88279ffd9162a19bdedd5d5a0a
'Api\\PhpServices\\Session\\RedisSessionHandler' => __DIR__ . '/..' . '/api/php_services/src/Session/RedisSessionHandler.php',
'Api\\PhpServices\\Session\\Session' => __DIR__ . '/..' . '/api/php_services/src/Session/Session.php',
'Api\\PhpServices\\Session\\SessionManager' => __DIR__ . '/..' . '/api/php_services/src/Session/SessionManager.php',
'Api\\PhpServices\\ShopImage\\GetImage' => __DIR__ . '/..' . '/api/php_services/src/ShopImage/GetImage.php',
'Api\\PhpServices\\ShopImage\\QR' => __DIR__ . '/..' . '/api/php_services/src/ShopImage/QR.php',
'Api\\PhpServices\\Towerpro\\Towerpro' => __DIR__ . '/..' . '/api/php_services/src/Towerpro/Towerpro.php',
'Api\\PhpServices\\Tuffy\\TuffyService' => __DIR__ . '/..' . '/api/php_services/src/Tuffy/TuffyService.php',
'Api\\PhpServices\\XhProfiler\\XhMongo' => __DIR__ . '/..' . '/api/php_services/src/XhProfiler/XhMongo.php',
......@@ -336,6 +336,7 @@ class ComposerStaticInit48fd9e88279ffd9162a19bdedd5d5a0a
'App\\Models\\shop\\mysql\\Shop' => __DIR__ . '/../..' . '/application/models/shop/mysql/Shop.php',
'App\\Models\\shop\\mysql\\SubShop' => __DIR__ . '/../..' . '/application/models/shop/mysql/SubShop.php',
'App\\Plugins\\Hook' => __DIR__ . '/../..' . '/application/plugins/Hook.php',
'App\\Services\\common\\CommonService' => __DIR__ . '/../..' . '/application/services/common/CommonService.php',
'App\\Services\\demo\\ElasticService' => __DIR__ . '/../..' . '/application/services/demo/ElasticService.php',
'App\\Services\\demo\\MongoService' => __DIR__ . '/../..' . '/application/services/demo/MongoService.php',
'App\\Services\\demo\\MysqlService' => __DIR__ . '/../..' . '/application/services/demo/MysqlService.php',
......
......@@ -7,7 +7,7 @@
"source": {
"type": "git",
"url": "https://git.yidian-inc.com:8021/bp/php_services.git",
"reference": "3a118172e1f4bb413ccbef92c037f4f3255b388a"
"reference": "d12158b756ba1aee7d019a8d25ca79f49bbe1d8c"
},
"require": {
"api/php_utils": "dev-master",
......@@ -15,7 +15,7 @@
"perftools/php-profiler": "^0.18.0",
"php": "7.2.*"
},
"time": "2021-06-25T11:16:31+00:00",
"time": "2021-06-28T03:58:57+00:00",
"default-branch": true,
"type": "library",
"installation-source": "source",
......@@ -34,7 +34,7 @@
"source": {
"type": "git",
"url": "https://git.yidian-inc.com:8021/bp/php_utils.git",
"reference": "16949fb782de0488cf192e3cd9d4e1268377294d"
"reference": "a6fdc2ddaf55ca6f8f86a3295b7659a70c50b2ec"
},
"require": {
"elasticsearch/elasticsearch": "~7.0",
......@@ -46,7 +46,7 @@
"mongodb/mongodb": "1.4.3",
"php": "7.2.*"
},
"time": "2021-06-26T06:31:48+00:00",
"time": "2021-06-28T03:25:55+00:00",
"default-branch": true,
"type": "library",
"installation-source": "source",
......@@ -1951,12 +1951,12 @@
"source": {
"type": "git",
"url": "https://github.com/symfony/string.git",
"reference": "92855c727d7edabe004605f451ef0b274fa24490"
"reference": "c29a3e649843f4a34eaa4be2683f4914e8b7f023"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/string/zipball/92855c727d7edabe004605f451ef0b274fa24490",
"reference": "92855c727d7edabe004605f451ef0b274fa24490",
"url": "https://api.github.com/repos/symfony/string/zipball/c29a3e649843f4a34eaa4be2683f4914e8b7f023",
"reference": "c29a3e649843f4a34eaa4be2683f4914e8b7f023",
"shasum": ""
},
"require": {
......@@ -1973,7 +1973,7 @@
"symfony/translation-contracts": "^1.1|^2",
"symfony/var-exporter": "^4.4|^5.0|^6.0"
},
"time": "2021-06-06T09:52:30+00:00",
"time": "2021-06-27T12:34:25+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
......
......@@ -6,7 +6,7 @@
'aliases' =>
array (
),
'reference' => '48662ee0ac551270f90d09cda3f0a1ab5d45c556',
'reference' => '0d55d1b988fb0ef7b715037568463cf4b8fa5e88',
'name' => 'yidian/yaf_demo',
),
'versions' =>
......@@ -19,7 +19,7 @@
array (
0 => '9999999-dev',
),
'reference' => '3a118172e1f4bb413ccbef92c037f4f3255b388a',
'reference' => 'd12158b756ba1aee7d019a8d25ca79f49bbe1d8c',
),
'api/php_utils' =>
array (
......@@ -29,7 +29,7 @@
array (
0 => '9999999-dev',
),
'reference' => '16949fb782de0488cf192e3cd9d4e1268377294d',
'reference' => 'a6fdc2ddaf55ca6f8f86a3295b7659a70c50b2ec',
),
'bacon/bacon-qr-code' =>
array (
......@@ -300,7 +300,7 @@
'aliases' =>
array (
),
'reference' => '92855c727d7edabe004605f451ef0b274fa24490',
'reference' => 'c29a3e649843f4a34eaa4be2683f4914e8b7f023',
),
'yidian/yaf_demo' =>
array (
......@@ -309,7 +309,7 @@
'aliases' =>
array (
),
'reference' => '48662ee0ac551270f90d09cda3f0a1ab5d45c556',
'reference' => '0d55d1b988fb0ef7b715037568463cf4b8fa5e88',
),
),
);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment