Commit 8dcf4a96 by 杨树贤

添加是否发邮件判断

parent 2cf74328
...@@ -348,8 +348,11 @@ class SyncSupplierService ...@@ -348,8 +348,11 @@ class SyncSupplierService
return true; return true;
} }
//本地
if (isDevEnvironment()) {
return true;
}
//return true; //return true;
//还要去发送邮箱给采购员,线上采购员,采购总 //还要去发送邮箱给采购员,线上采购员,采购总
$data['data']['supplier_code'] = $supplier['supplier_code']; $data['data']['supplier_code'] = $supplier['supplier_code'];
$data['data']['supplier_name'] = $supplier['supplier_name']; $data['data']['supplier_name'] = $supplier['supplier_name'];
......
...@@ -228,15 +228,15 @@ function checkArrayAllValueNull($array, $excludeField = []) ...@@ -228,15 +228,15 @@ function checkArrayAllValueNull($array, $excludeField = [])
function generateMobile($count) function generateMobile($count)
{ {
$arr = [ $arr = [
130,131,132,133,134,135,136,137,138,139, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139,
144,147, 144, 147,
150,151,152,153,155,156,157,158,159, 150, 151, 152, 153, 155, 156, 157, 158, 159,
176,177,178, 176, 177, 178,
180,181,182,183,184,185,186,187,188,189, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189,
]; ];
$phone = []; $phone = [];
for($i = 0; $i < $count; $i++) { for ($i = 0; $i < $count; $i++) {
$phone[] = $arr[array_rand($arr)].''.mt_rand(1000,9999).''.mt_rand(1000,9999); $phone[] = $arr[array_rand($arr)] . '' . mt_rand(1000, 9999) . '' . mt_rand(1000, 9999);
} }
return array_unique($phone); return array_unique($phone);
} }
...@@ -251,21 +251,21 @@ function makePassword($length) ...@@ -251,21 +251,21 @@ function makePassword($length)
// 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y','Z', // 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y','Z',
// '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'); // '0', '1', '2', '3', '4', '5', '6', '7', '8', '9');
$str = array('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', $str = array('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h',
'i', 'j', 'k', 'l','m', 'n', 'o', 'p', 'q', 'r', 's', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's',
't', 'u', 'v', 'w', 'x', 'y','z', 't', 'u', 'v', 'w', 'x', 'y', 'z',
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9'); '0', '1', '2', '3', '4', '5', '6', '7', '8', '9');
// 在 $str 中随机取 $length 个数组元素键名 // 在 $str 中随机取 $length 个数组元素键名
$keys = array_rand($str, $length); $keys = array_rand($str, $length);
$password = ''; $password = '';
for($i = 0; $i < $length; $i++) for ($i = 0; $i < $length; $i++) {
{
// 将 $length 个数组元素连接成字符串 // 将 $length 个数组元素连接成字符串
$password .= $str[$keys[$i]]; $password .= $str[$keys[$i]];
} }
return $password; return $password;
} }
function isDateTime($dateTime){ function isDateTime($dateTime)
{
$ret = strtotime($dateTime); $ret = strtotime($dateTime);
return $ret !== FALSE && $ret != -1; return $ret !== FALSE && $ret != -1;
} }
...@@ -327,3 +327,8 @@ function replaceSpace($str) ...@@ -327,3 +327,8 @@ function replaceSpace($str)
$str = trim($str); $str = trim($str);
return $str; return $str;
} }
function isDevEnvironment()
{
return config('perm.perm.menuId') == 16;
}
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 sign in to comment