电话
This commit is contained in:
parent
3c3a456393
commit
429835252b
@ -88,7 +88,7 @@ class AddedOrderSync extends Command
|
||||
$starttime = $this->datetime->copy()->startOfMonth()->startOfDay();
|
||||
$endtime = $this->datetime->copy()->endOfMonth()->endOfDay();
|
||||
|
||||
$orders = DB::table($virtualTable)->selectRaw('sim,MAX(order_id)')
|
||||
$orders = DB::table($virtualTable)->selectRaw('sim, MAX(order_id)')
|
||||
->where('created_at', '>=', $starttime->format('Y-m-d H:i:s'))
|
||||
->where('created_at', '<=', $endtime->format('Y-m-d H:i:s'))
|
||||
->whereIn('sim', array_pluck($data, 'sim'))
|
||||
@ -101,7 +101,9 @@ class AddedOrderSync extends Command
|
||||
|
||||
MongoCardJob::dispatch(array_pluck($data, 'sim'));
|
||||
|
||||
DB::table($table)->upsert($data, ['sim', 'order_id']);
|
||||
$only = ['company_id', 'package_id', 'counts', 'unit_price'];
|
||||
|
||||
DB::table($table)->upsert($data, ['sim', 'order_id', 'deleted_at'], $only);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -56,8 +56,11 @@ class OrderBaseSync extends Command
|
||||
|
||||
MongoCardJob::dispatch(array_pluck($data, 'sim'));
|
||||
|
||||
DB::table('real_order_cards')->upsert($data, ['sim', 'deleted_at']);
|
||||
$only = [ 'order_id', 'company_id', 'package_id', 'counts', 'unit_price'];
|
||||
|
||||
DB::table('real_order_cards')->upsert($data, ['sim', 'deleted_at'], $only);
|
||||
}
|
||||
|
||||
app(OrderCardPartitionRepository::class)->forgetCached();
|
||||
$this->line('插入订单关联数据成功');
|
||||
});
|
||||
@ -122,7 +125,7 @@ class OrderBaseSync extends Command
|
||||
'order_at' => Carbon::parse($item['o_create_date'])->format('Y-m-d H:i:s'),
|
||||
'address' => $item['o_address'],
|
||||
'contacts' => $item['o_contacts'],
|
||||
'mobile' => $item['o_contact_number'],
|
||||
'mobile' => substr(preg_replace('/[^0-9]+/', '', single_case($item['o_contact_number'])), 0, 11),
|
||||
'remark' => $item['o_remark'],
|
||||
'logistics_remark' => $item['o_logistics_content'],
|
||||
'created_at' => date('Y-m-d H:i:s', $item['o_create_time']),
|
||||
|
@ -244,3 +244,40 @@ if (! function_exists('range_compare')) {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
if (! function_exists('single_case')) {
|
||||
/**
|
||||
* 将一个字串中含有全角的数字字符、字母、空格或'%+-()'字符转换为相应半角字符
|
||||
*
|
||||
* @access public
|
||||
* @param string $str 待转换字串
|
||||
* @return string
|
||||
*/
|
||||
function single_case($str)
|
||||
{
|
||||
$arr = array('0' => '0', '1' => '1', '2' => '2', '3' => '3', '4' => '4',
|
||||
'5' => '5', '6' => '6', '7' => '7', '8' => '8', '9' => '9',
|
||||
'A' => 'A', 'B' => 'B', 'C' => 'C', 'D' => 'D', 'E' => 'E',
|
||||
'F' => 'F', 'G' => 'G', 'H' => 'H', 'I' => 'I', 'J' => 'J',
|
||||
'K' => 'K', 'L' => 'L', 'M' => 'M', 'N' => 'N', 'O' => 'O',
|
||||
'P' => 'P', 'Q' => 'Q', 'R' => 'R', 'S' => 'S', 'T' => 'T',
|
||||
'U' => 'U', 'V' => 'V', 'W' => 'W', 'X' => 'X', 'Y' => 'Y',
|
||||
'Z' => 'Z', 'a' => 'a', 'b' => 'b', 'c' => 'c', 'd' => 'd',
|
||||
'e' => 'e', 'f' => 'f', 'g' => 'g', 'h' => 'h', 'i' => 'i',
|
||||
'j' => 'j', 'k' => 'k', 'l' => 'l', 'm' => 'm', 'n' => 'n',
|
||||
'o' => 'o', 'p' => 'p', 'q' => 'q', 'r' => 'r', 's' => 's',
|
||||
't' => 't', 'u' => 'u', 'v' => 'v', 'w' => 'w', 'x' => 'x',
|
||||
'y' => 'y', 'z' => 'z',
|
||||
'(' => '(', ')' => ')', '〔' => '[', '〕' => ']', '【' => '[',
|
||||
'】' => ']', '〖' => '[', '〗' => ']', '“' => '[', '”' => ']',
|
||||
'‘' => '[', '’' => ']', '{' => '{', '}' => '}', '《' => '<',
|
||||
'》' => '>',
|
||||
'%' => '%', '+' => '+', '—' => '-', '-' => '-', '~' => '-',
|
||||
':' => ':', '。' => '.', '、' => ',', ',' => '.', '、' => '.',
|
||||
';' => ',', '?' => '?', '!' => '!', '…' => '-', '‖' => '|',
|
||||
'”' => '"', '’' => '`', '‘' => '`', '|' => '|', '〃' => '"',
|
||||
' ' => ' ');
|
||||
|
||||
return strtr($str, $arr);
|
||||
}
|
||||
}
|
||||
|
@ -48,23 +48,23 @@ class CreateRealOrderCardsTable extends Migration
|
||||
});
|
||||
|
||||
Schema::table('real_order_renewal_cards', function (Blueprint $table) {
|
||||
$table->unique(['sim', 'order_id']);
|
||||
$table->unique(['sim', 'order_id', 'deleted_at']);
|
||||
});
|
||||
|
||||
Schema::table('real_order_renewal_package_cards', function (Blueprint $table) {
|
||||
$table->unique(['sim', 'order_id']);
|
||||
$table->unique(['sim', 'order_id', 'deleted_at']);
|
||||
});
|
||||
|
||||
Schema::table('real_order_flows_package_cards', function (Blueprint $table) {
|
||||
$table->unique(['sim', 'order_id']);
|
||||
$table->unique(['sim', 'order_id', 'deleted_at']);
|
||||
});
|
||||
|
||||
Schema::table('real_order_optional_package_cards', function (Blueprint $table) {
|
||||
$table->unique(['sim', 'order_id']);
|
||||
$table->unique(['sim', 'order_id', 'deleted_at']);
|
||||
});
|
||||
|
||||
Schema::table('real_order_additional_package_cards', function (Blueprint $table) {
|
||||
$table->unique(['sim', 'order_id']);
|
||||
$table->unique(['sim', 'order_id', 'deleted_at']);
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -7,5 +7,3 @@ use Illuminate\Database\Schema\Blueprint;
|
||||
use App\Domains\Virtual\Services\OrderService;
|
||||
|
||||
require_once realpath(dirname(__FILE__) . '/TestCase.php');
|
||||
|
||||
app(OrderService::class);
|
||||
|
Loading…
x
Reference in New Issue
Block a user