123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110 |
- <?php
- /**
- * Created by PhpStorm.
- * User: Bear
- * Date: 2018/11/22
- * Time: 下午5:08
- */
- use app\common\service\OrderService;
- use app\admin\model\PalmpaySplitAccountLog;
- use app\main\service\AdminService;
- class OrderTest extends TestInit
- {
- public function testMonthService()
- {
- $start_time = strtotime('2020-02-15');
- $end_time = time();
- $data = \app\main\service\OrderService::instance()->getOrderKlData($start_time, $end_time)->data;
- \app\main\service\OrderService::instance()->updateKlTable($data);
- }
- public function testDayService()
- {
- $admin_id = 9;
- $date_range = '20181022,20181121';
- $result = OrderService::instance()->getDayServiceReport($admin_id, $date_range, 0, 10);
- var_dump($result);
- }
- public function testDay()
- {
- $admin_id = 9;
- $date_range = '20181022,20181121';
- $result = OrderService::instance()->getDayReport($admin_id, $date_range, 0, 10);
- var_dump($result);
- }
- public function testMonth()
- {
- $admin_id = 9;
- $date_range = '201810,201811';
- $result = OrderService::instance()->getMonthReport($admin_id, $date_range, 0, 10);
- var_dump($result);
- }
- public function testDayFormat()
- {
- $time = '201812';
- $time = $time . str_pad(date('d') - 1, 2, '0', STR_PAD_LEFT);
- $this->assertTrue($time == '20181203');
- }
- public function testGetSql()
- {
- $sql = "ALTER TABLE `cps_user_{db_index}`.`user` ADD COLUMN `is_first_unfollow` enum('0','1','2') NOT NULL DEFAULT '2' COMMENT '是否首次取消关注:0=否,1=是,2=未取关' AFTER `updatetime`;";
- for ($i = 0; $i < 512; $i++) {
- echo str_replace('{db_index}', $i, $sql)."\n";
- }
- }
- public function testDzAccount()
- {
- $data = OrderService::instance()->getDzAccount('zsjwsfz.wnread.cn');
- var_dump($data);
- }
- public function testChannelAccount()
- {
- $data = OrderService::instance()->getChannelAccount(1, 3);
- var_dump($data);
- }
- public function testOrderId()
- {
- var_dump(OrderService::instance()->getUniqueOrder());
- }
- public function testOrderCmd()
- {
- $_SERVER['HTTP_X_REAL_HOST'] = 'zsjwsfz.wnread.cn';
- $data = OrderService::instance()->getPalmPayCmd(0.03, 3);
- var_dump($data);
- }
- public function testCreate(){
- PalmpaySplitAccountLog::create(['order_id'=>1,'dz_palmpay_sub_account_id'=>1,'dz_amount'=>1,'channel_palmpay_sub_account_id'=>1,'channel_amount'=>1])->insert();
- }
- public function testReferralDayData() {
- \app\main\service\ReferralService::instance()->updateDayData(961, ['orders_num' => 1, 'recharge_money' => 0.01], 1563551999);
- }
- public function testRechargeRecord()
- {
- $data = \app\main\service\OrderService::instance()->getRechargeRecord(60007, 1, 10);
- var_dump($data);
- }
- public function testUserCount()
- {
- $channelList = AdminService::instance()->getAdminConfigModel()
- ->join('admin a','a.id=admin_config.admin_id')
- ->whereIn('a.id', [1734])
- ->select();
- var_dump($channelList);
- }
- }
|