TestlAmountStats.php 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <?php
  2. use PHPUnit\Framework\TestCase;
  3. use const mtopcard\ProvinceList;
  4. define('APP_ID', 'test');
  5. define('BASE_ROOT_PATH', str_replace('/test', '', dirname(__FILE__)));
  6. require_once(BASE_ROOT_PATH . '/global.php');
  7. require_once(BASE_CORE_PATH . '/lrlz.php');
  8. const CurrentTest = NetTest;
  9. class TestlAmountStats extends TestCase
  10. {
  11. public static function setUpBeforeClass(): void
  12. {
  13. Base::run_util();
  14. }
  15. public function testset_cache()
  16. {
  17. $cache_key = 'amount_stats_settings';
  18. $channel_names = ['泰山','沧沧' ,'驰增', '达尚', '点充', '盲盒', '多鲸'];//上游名称
  19. $merchant_names = ['华融','车卫士','海南','XX'];//下游名称
  20. $channel_fast = [];//快充通道
  21. $channel_normal = [];//普充通道
  22. $merchant = [];//机构
  23. $writer = function ($key,$val) use($cache_key) {
  24. $cache = rcache($cache_key, 'refill-');
  25. $data = unserialize($cache['data']) ?? [];
  26. $data[$key] = $val;
  27. wcache($cache_key, ['data' => serialize($data)], 'refill-');
  28. };
  29. $writer('channel_names', $channel_names);
  30. $writer('merchant_names', $merchant_names);
  31. $writer('channel_fast', $channel_fast);
  32. $writer('channel_normal', $channel_normal);
  33. $writer('merchant', $merchant);
  34. $read = rcache($cache_key, 'refill-');
  35. $read = unserialize($read['data']);
  36. }
  37. public function testdaily_statement_data()
  38. {
  39. $model_refill_order = Model('refill_order');
  40. $condition['type'] = 'provider';
  41. $condition['time_text'] = '2022-09-01';
  42. // $condition['order_time_type'] = 'notify_time';
  43. // $condition['cid'] = ['in', '319,326,327,234'];
  44. $list = $model_refill_order->getOrderStatsListAll($condition, '*', 'time_stamp desc, cname asc');
  45. }
  46. }