changePd('sys_add_money',$data_pd,true); $model_pd->changePd('sys_del_money',$data_pd,true); } //docker-compose run -d phpcli php /var/www/html/phpunit-9.2.5.phar --filter "/(TestPdDivert::testChangeA)( .*)?$/" --test-suffix TestPdDivert.php /var/www/html/test public function testChangeA() { Log::short_name('dirvert_a'); $this->trans_change(); } //docker-compose run -d phpcli php /var/www/html/phpunit-9.2.5.phar --filter "/(TestPdDivert::testChangeB)( .*)?$/" --test-suffix TestPdDivert.php /var/www/html/test public function testChangeB() { Log::short_name('dirvert_b'); $this->trans_change(); } //docker-compose run -d phpcli php /var/www/html/phpunit-9.2.5.phar --filter "/(TestPdDivert::testChangeC)( .*)?$/" --test-suffix TestPdDivert.php /var/www/html/test public function testChangeC() { Log::short_name('dirvert_c'); $this->trans_change(); } //docker-compose run -d phpcli php /var/www/html/phpunit-9.2.5.phar --filter "/(TestPdDivert::testChangeD)( .*)?$/" --test-suffix TestPdDivert.php /var/www/html/test public function testChangeD() { Log::short_name('dirvert_d'); $this->trans_change(); } //docker-compose run -d phpcli php /var/www/html/phpunit-9.2.5.phar --filter "/(TestPdDivert::testChangeE)( .*)?$/" --test-suffix TestPdDivert.php /var/www/html/test public function testChangeE() { Log::short_name('dirvert_e'); $this->trans_change(); } private function change() { $total = 0.0000; for($i = 0; $i < 10000000; $i++) { $amount = mt_rand(-1000,1000); $total += $amount; $data_pd['member_id'] = 65741; $data_pd['amount'] = $amount > 0.0000 ? $amount : -$amount; $model_pd = Model('predeposit'); try { if($amount > 0.0000) { $model_pd->changePd('order_pay',$data_pd,true); } else { $model_pd->changePd('order_cancel',$data_pd,true); } } catch (Exception $ex) { Log::record($ex->getMessage(),Log::ERR); } } Log::record("testChange total = $total",Log::DEBUG); } private function trans_change() { $total = 0.0000; for($i = 0; $i < 10000000; $i++) { $amount = mt_rand(-1000,1000); $total += $amount; $data_pd['member_id'] = 65741; $data_pd['amount'] = $amount > 0.0000 ? $amount : -$amount; $model_pd = Model('predeposit'); $trans = new trans_wapper($model_pd, __METHOD__); try { if($amount > 0.0000) { $model_pd->changePd('order_pay',$data_pd,true); } else { $model_pd->changePd('order_cancel',$data_pd,true); } $trans->commit(); } catch (Exception $ex) { $trans->rollback(); Log::record($ex->getMessage(),Log::ERR); } } Log::record("testChange total = $total",Log::DEBUG); } }