InitCourseCommand.php 67 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827
  1. <?php
  2. namespace App\Console\Commands;
  3. use App\Repositories\Enums\ModelStatusEnum;
  4. use App\Repositories\Models\Base\Resource;
  5. use App\Repositories\Models\Course\Chapter;
  6. use App\Repositories\Models\Course\Course;
  7. use App\Repositories\Models\Course\Video;
  8. use App\Repositories\Models\TCM\Combinations;
  9. use App\Repositories\Models\TCM\Prescription;
  10. use App\Repositories\Models\TCM\Recipels;
  11. use App\Services\CombinationService;
  12. use Carbon\Carbon;
  13. use Illuminate\Console\Command;
  14. use Illuminate\Support\Facades\DB;
  15. use Illuminate\Support\Facades\File;
  16. use Illuminate\Support\Facades\Storage;
  17. use Illuminate\Support\Str;
  18. /**
  19. * Class PresenterCommand
  20. * @package Prettus\Repository\Generators\Commands
  21. * @author Anderson Andrade <contato@andersonandra.de>
  22. */
  23. class InitCourseCommand extends Command
  24. {
  25. public static $COURSE_MAPS = [
  26. '中医基础理论' => [
  27. 'name' => 'zhongyililunjichu',
  28. 'chapter' => [
  29. '绪论' => 'introduction',
  30. '哲学基础' => 'philosophical-basis',
  31. '藏象' => 'zangxiang',
  32. '精 气 血 津液' => 'bodyfluid',
  33. '经络' => 'jingluo',
  34. '体质' => 'constitution',
  35. '病因' => 'pathogeny',
  36. '病机' => 'bingji',
  37. '养生防治' => 'health',
  38. ]
  39. ]
  40. ];
  41. /**
  42. * The name of command.
  43. *
  44. * @var string
  45. */
  46. protected $name = 'init:course';
  47. /**
  48. * The description of command.
  49. *
  50. * @var string
  51. */
  52. protected $description = 'Create a new course.';
  53. /**
  54. * The type of class being generated.
  55. *
  56. * @var string
  57. */
  58. protected $type = 'course';
  59. /**
  60. * Execute the command.
  61. *
  62. * @return void
  63. * @see fire()
  64. */
  65. public function handle()
  66. {
  67. // $data = [
  68. // //推拿
  69. // [
  70. // 'url' => 'tuina',
  71. // 'lang' => 'zh_CN',
  72. // 'course_id' => 0,
  73. // 'is_close_chapter' => 1,
  74. // 'title' => '推拿',
  75. // ],
  76. // [
  77. // 'url' => 'tuina',
  78. // 'lang' => 'en',
  79. // 'course_id' => 0,
  80. // 'is_close_chapter' => 1,
  81. // 'title' => 'Tuina',
  82. // ],
  83. // //中医诊断
  84. // [
  85. // 'url' => 'zhenduanxue',
  86. // 'lang' => 'zh_CN',
  87. // 'course_id' => 0,
  88. // 'is_close_chapter' => 0,
  89. // 'title' => '中医诊断学',
  90. // ],
  91. // [
  92. // 'url' => 'zhenduanxue',
  93. // 'lang' => 'en',
  94. // 'course_id' => 0,
  95. // 'is_close_chapter' => 0,
  96. // 'title' => 'TCM Diagnostic ',
  97. // ],
  98. // //针灸学
  99. // [
  100. // 'url' => 'zhenjiuxue',
  101. // 'lang' => 'zh_CN',
  102. // 'course_id' => 0,
  103. // 'is_close_chapter' => 0,
  104. // 'title' => '针灸临床学',
  105. // ],
  106. // [
  107. // 'url' => 'zhenjiuxue',
  108. // 'lang' => 'en',
  109. // 'course_id' => 0,
  110. // 'is_close_chapter' => 1,
  111. // 'title' => 'Clinical Acupuncture',
  112. // ],
  113. // //中药鉴定
  114. // [
  115. // 'url' => 'zhongyaojianding',
  116. // 'lang' => 'zh_CN',
  117. // 'course_id' => 0,
  118. // 'is_close_chapter' => 0,
  119. // 'title' => '中药鉴定',
  120. // ],
  121. // [
  122. // 'url' => 'zhongyaojianding',
  123. // 'lang' => 'en',
  124. // 'course_id' => 0,
  125. // 'is_close_chapter' => 0,
  126. // 'title' => 'Herbal medicine identification',
  127. // ],
  128. // //中医基础理论
  129. // [
  130. // 'url' => 'zhongji-zh',
  131. // 'lang' => 'zh_CN',
  132. // 'course_id' => 1,
  133. // 'is_close_chapter' => 0,
  134. // 'title' => '',
  135. // ],
  136. // [
  137. // 'url' => 'zhongji-en',
  138. // 'lang' => 'en',
  139. // 'course_id' => 2,
  140. // 'is_close_chapter' => 0,
  141. // 'title' => '',
  142. // ],
  143. // ];
  144. $videos = Video::query()->whereIn('course_id', [16, 17])->get();
  145. foreach ($videos as $video) {
  146. $video->title = str_replace(['2024-01-14/zhongyao/', '.mp4'], '', $video->title);
  147. $video->save();
  148. }
  149. dd(1);
  150. $data = [
  151. //推拿
  152. [
  153. 'name' => 'zhongyao',
  154. 'lang' => 'zh_CN',
  155. 'course_id' => 0,
  156. 'is_close_chapter' => 1,
  157. 'title' => '药食同源疗百病·一带一路送健康',
  158. ],
  159. [
  160. 'name' => 'zhongyao',
  161. 'lang' => 'en',
  162. 'course_id' => 0,
  163. 'is_close_chapter' => 1,
  164. 'title' => '药食同源疗百病·一带一路送健康',
  165. ],
  166. // //中医诊断
  167. // [
  168. // 'url' => 'zhongyiwenhua-jingluoshuxuanxue',
  169. // 'lang' => 'zh_CN',
  170. // 'course_id' => 0,
  171. // 'is_close_chapter' => 0,
  172. // 'title' => '中医文化《经络腧穴学》',
  173. // ],
  174. // [
  175. // 'url' => 'zhongyiwenhua-jingluoshuxuanxue',
  176. // 'lang' => 'en',
  177. // 'course_id' => 0,
  178. // 'is_close_chapter' => 0,
  179. // 'title' => '中医文化《经络腧穴学》 ',
  180. // ],
  181. ];
  182. //
  183. foreach ($data as $da) {
  184. // $this->loadLocalFiles($da['url'], $da['lang'], $da['course_id'], $da['is_close_chapter'], $da['title']);
  185. // $this->loadLocalFiles($da['name'], $da['lang'], $da['course_id'], $da['is_close_chapter'], $da['title']);
  186. $this->readJson($da['name'], $da['lang'], $da['course_id'], $da['is_close_chapter'], $da['title']);
  187. }
  188. // $data = file_get_contents(base_path('data/zhongyiwenhua-jingluoshuxuanxue.json'));
  189. // $data = json_decode($data, true);
  190. //
  191. // file_put_contents(base_path('data/zhongyiwenhua-jingluoshuxuanxue.json'), json_encode($data, JSON_UNESCAPED_UNICODE));
  192. // dd(1);
  193. // $courses = [12, 13];
  194. // $t = Video::query()->where('course_id', 12)->count();
  195. // $this->line("total:{$t}");
  196. // $data = file_get_contents(base_path('data/youjihuaxueshuangyu.json'));
  197. // $data = json_decode($data, true);
  198. // foreach ($data['Videos'] as $k => $v) {
  199. // $sort = $t - $k;
  200. // $this->line("{$v['name']}==>{$sort}");
  201. // Video::query()->whereIn('course_id', $courses)->where('title', $v['name'])->update(['sort' => $sort]);
  202. // }
  203. //
  204. // $courses = [14, 15];
  205. // $t = Video::query()->where('course_id', 12)->count();
  206. // $this->line("total:{$t}");
  207. // $data = file_get_contents(base_path('data/zhongyiwenhua-jingluoshuxuanxue.json'));
  208. // $data = json_decode($data, true);
  209. // foreach ($data['Videos'] as $k => $v) {
  210. // $sort = $t - $k;
  211. // $this->line("{$v['name']}==>{$sort}");
  212. // Video::query()->whereIn('course_id', $courses)->where('title', $v['name'])->update(['sort' => $sort]);
  213. // }
  214. $this->line('ok');
  215. }
  216. public function loadLocalFiles($url_path, $lang)
  217. {
  218. $base_lang = $lang;
  219. $base_url = 'http://zhongma.qiniu.xmnk.cn/';
  220. $videos = [];
  221. $sections = [];
  222. //读取文件
  223. $files_json = js2php(file_get_contents(base_path("data/{$url_path}.json")));
  224. $files = $files_json['items'];
  225. //处理章节
  226. foreach ($files as $file) {
  227. if (!$file['fsize']) continue;
  228. $video = [
  229. 'section' => 0,
  230. 'video' => false,
  231. 'video_path' => false,
  232. 'srt' => false,
  233. ];
  234. $fileArr = pathinfo($file['key']);
  235. if (array_key_exists('extension', $fileArr)) {
  236. switch (strtolower($fileArr['extension'])) {
  237. case 'txt':
  238. // $file_data = str2arr0($file['key'], '-');
  239. // $name = $file_data[1];
  240. // if ($base_lang == 'en') $name = $file_data[2];
  241. // $sections[$file_data[0]] = [
  242. // 'name' => $name,
  243. // 'en_name' => $file_data[2],
  244. // ];
  245. break;
  246. case 'mp4':
  247. $name = $file['key'];
  248. $s[0] = 'Videos';
  249. $videos[$s[0]][] = [
  250. 'section' => $s[0],
  251. 'name' => $fileArr['filename'],
  252. 'en_name' => $fileArr['filename'],
  253. 'path' => "{$base_url}" . $file['key'],
  254. 'srt' => false
  255. ];
  256. break;
  257. case 'srt':
  258. break;
  259. }
  260. } else {
  261. $file_data = str2arr0($file['filename'], '-');
  262. $name = $file_data[1];
  263. if (count($file_data) == 2) {
  264. $sections[$file_data[0]] = [
  265. 'name' => $name,
  266. 'en_name' => $file_data[1],
  267. ];
  268. } else {
  269. if ($base_lang == 'en') $name = $file_data[2];
  270. $sections[$file_data[0]] = [
  271. 'name' => $name,
  272. 'en_name' => $file_data[2],
  273. ];
  274. }
  275. }
  276. }
  277. return $videos;
  278. }
  279. public function readJson($url_path, $lang, $course_id, $is_close_chapter, $title)
  280. {
  281. $base_lang = $lang;
  282. $base_course_id = $course_id;
  283. $videos = $this->loadLocalFiles($url_path, $lang);
  284. //保存数据
  285. if ($base_course_id) {
  286. $course = Course::query()->find($base_course_id);
  287. } else {
  288. $course = Course::query()->create([
  289. 'title' => $title,
  290. 'language' => $base_lang,
  291. 'admin_id' => 1,
  292. 'status' => 1,
  293. 'slug' => Str::random(8),
  294. 'published_at' => Carbon::now()->toDateTimeString(),
  295. ]);
  296. }
  297. Chapter::query()->where('course_id', $course->id)->delete();
  298. Video::query()->where('course_id', $course->id)->delete();
  299. DB::beginTransaction();
  300. try {
  301. foreach ($videos as $s => $vs) {
  302. $section['name'] = $s;
  303. $chapter = Chapter::query()->withoutGlobalScope('language')->updateOrCreate([
  304. 'course_id' => $course->id,
  305. 'title' => $section['name'],
  306. 'language' => $base_lang,
  307. ], [
  308. 'status' => ModelStatusEnum::OK
  309. ]);
  310. foreach ($vs as $video) {
  311. $resource = Resource::query()->withoutGlobalScope('language')->updateOrCreate([
  312. 'name' => $video['name'],
  313. 'original_name' => $video['name'],
  314. 'path' => $video['path'],
  315. ], [
  316. 'disk' => 'qiniu',
  317. 'url' => $video['path'],
  318. 'size' => 0,
  319. 'language' => $base_lang,
  320. 'status' => ModelStatusEnum::OK,
  321. ]);
  322. $subtitle_resource = null;
  323. if ($video['srt']) {
  324. $subtitle_resource = Resource::query()->withoutGlobalScope('language')->updateOrCreate([
  325. 'path' => $video['srt']['path'],
  326. ], [
  327. 'name' => Str::random(8) . '.srt',
  328. 'original_name' => $video['srt']['name'],
  329. 'disk' => 'public',
  330. 'url' => $video['srt']['path'],
  331. 'size' => 0,
  332. 'language' => $base_lang,
  333. 'status' => ModelStatusEnum::OK,
  334. ]);
  335. }
  336. Video::query()->withoutGlobalScope('language')->updateOrCreate([
  337. 'course_id' => $course->id,
  338. 'course_chapter_id' => $chapter->id,
  339. 'title' => $video['name'],
  340. ], [
  341. 'slug' => Str::random(),
  342. 'language' => $base_lang,
  343. 'url' => $resource->id,
  344. 'published_at' => Carbon::now()->toDateTimeString(),
  345. 'subtitle_zh_path' => $subtitle_resource ? $subtitle_resource->id : '',
  346. 'subtitle_en_path' => $subtitle_resource ? $subtitle_resource->id : '',
  347. 'status' => ModelStatusEnum::OK
  348. ]);
  349. }
  350. }
  351. DB::commit();
  352. } catch (\Exception $exception) {
  353. DB::rollBack();
  354. dd($exception);
  355. }
  356. }
  357. public function loadFiles($url_path, $lang, $course_id, $is_close_chapter, $title)
  358. {
  359. $base_lang = $lang;
  360. $base_url = 'http://zhongma.qiniu.xmnk.cn/' . $url_path;
  361. $base_course_id = $course_id;
  362. $videos = [];
  363. $sections = [];
  364. $i = 0;
  365. $files = '';
  366. switch ($url_path) {
  367. case 'tuina':
  368. $files = "1-推拿手法-Massage technique;1.1-按法-According to the law.mp4;1.2-拔身法-Body pulling method.mp4;1.3-背法-Back.mp4;1.4-拨法-Dial method.mp4;1.5-擦法-Rubbing method.mp4;1.6-点法-Point method.mp4;1.7-抖法-Shake method.mp4;1.8-复合手法-Compound technique.mp4;1.9-击法-Hit method.mp4;2.0-肩关节肘关节扳法-Shoulder joint and elbow joint pulling.mp4;2.1-颈腰椎斜扳法-Oblique pulling method of cervical and lumbar vertebrae.mp4;2.2-摩法-Rubbing method.mp4;2.3-抹法-Plastering.mp4;2.4-拿法-Manipulation.mp4;2.5-捏法-Kneading method.mp4;2.6-拍法-Beating method.mp4;2.7-屈伸法-Bending extension method.mp4;2.8-揉法-Rubbing method.mp4;2.9-推法-Deduction.mp4;3.0-推拿常用体位-Common postures for massage.mp4;3.1-推拿介质和热敷-Massage media and hot compress.mp4;3.2-推拿手法的定义和分类-Definition and classification of massage techniques.mp4;3.3-推拿手法的注意事项-Precautions for Massage Manipulation.mp4;3.4-推拿手法相关要求-Requirements for Massage Manipulation.mp4;3.5-摇法-Shaking method.mp4;3.6-一指禅推法-One Finger Zen Push Method.mp4;3.7-振法-Vibration method.mp4;3.8-㨰法-Law.mp4";
  369. break;
  370. case 'zhenjiuxue':
  371. $files = "1-针灸学绪论-Introduction to Acupuncture and Moxibustion;1.1-针灸的萌芽与形成-The germination and formation of acupuncture and moxibustion.mp4;1.2-针灸学的发展与鼎盛-The Development and Prosperity of Acupuncture and Moxibustion.mp4;1.3-针灸学的低俗复兴与对外传播-Vulgar revival and external dissemination of acupuncture and moxibustion.mp4;1.4-针灸学4—4 -Acupuncture 3—1.mp4;1.5-针灸学4—3-Acupuncture 4—3.mp4;2-针灸学绪论-General Theory of Meridians;2.1-经络概述-Overview of Meridians.mp4;2.2-经络系统的组成-Composition of Meridian system.mp4;2.3-经络的作用和临床应用-Function and clinical application of meridians.mp4;3-腧穴总论-Overview of acupoints;3.1-五腧穴-Five Shu Points.mp4;3.2-原穴-Original acupoint.mp4;3.3-八脉交会穴,下肢部下合穴(c)-Eight Meridians Intersection Point, Lower Limb Joint Point (c).mp4;4-刺灸法各论-On Acupuncture and Moxibustion;4.1-腧穴定位法-Point positioning method.mp4;4.2-骨度分寸定位法-Osteometric positioning method.mp4;4.3-毫针刺法的进针法 - Needling method of filiform needling.mp4;4.4-毫针刺法概述及操作准备-Overview and operation preparation of filiform needle needling.mp4;4.5-三棱针法一-Three edged needle method I.mp4;4.6-三棱针法二-Three edged needle method II.mp4;4.7-拔罐法-Cupping.mp4;5-耳针-Ear acupuncture;5.1-耳针法简介- Introduction to ear acupuncture.mp4;5.2-耳廓表面解剖- Surface anatomy of auricle.mp4;5.3-耳穴分布规律及选穴原则- Distribution rule and selection principle of auricular points.mp4;5.4-耳垂、耳背部耳穴分区定位- Localization of ear lobe and ear points at the back of the ear.mp4;5.5-耳穴诊察方法- Ear point diagnosis method.mp4;5.6-对耳轮、三角窝部耳穴分区定位- Localization of auricular points at the ear wheel and triangular fossa.mp4;5.7-耳甲部耳穴分区定位- Localization of auricular points of concha.mp4;5.8-耳轮、耳舟部耳穴分区定位- Localization of auricular points of ear wheel and ear boat.mp4;5.9-耳屏、对耳屏部耳穴分区定位- Localization of auricular points on the tragus.mp4;5.10-耳穴毫针刺法-Ear point filiform needling.mp4;5.11-耳针操作—压籽法- Ear acupuncture operation seed pressing method.mp4;5.12-耳针操作—刺血法 - Ear acupuncture operation - blood pricking method.mp4;6-悬起灸法- Suspension moxibustion;6.1-悬起灸法概述及艾条的介绍- Overview of hanging moxibustion and introduction of moxa stick.mp4;6.2-悬起灸的操作前准备及操作方法- Preparation and operation methods before suspension moxibustion.mp4;6.3-悬起灸法的注意事项与临床应用 - Precautions and clinical application of suspension moxibustion.mp4;7-间接灸之隔姜灸- Indirect moxibustion with ginger;7.1-间接灸之隔姜灸概述及用具-Overview and tools of indirect ginger separated moxibustion.mp4;7.2-隔姜灸的操作方法及临床应用- Operation method and clinical application of ginger separated moxibustion.mp4;8-间接灸之隔蒜灸-Indirect moxibustion with garlic;8.1-间接灸之隔蒜灸概述及用具- Overview and appliance of indirect moxibustion with garlic.mp4;8.2-隔蒜灸的操作方法及临床应用- Operation method and clinical application of garlic separated moxibustion.mp4;9-间接灸之隔盐灸- Indirect moxibustion with salt;9.1-间接灸之隔盐灸概述及用具- Overview and appliances of indirect moxibustion with salt.mp4;9.2-隔盐灸的操作方法及临床应用- Operation method and clinical application of salt separated moxibustion.mp4;10- 督脉隔姜灸-Dumai ginger separated moxibustion;10.1- 督脉隔姜灸-Dumai ginger separated moxibustion.mp4";
  372. break;
  373. case 'zhenduanxue':
  374. $files = "0-绪论-Introduction;0.1-绪论-Introduction.mp4;0.2-中医诊断的发展简史-Brief history of TCM diagnosis.mp4;0.3-中医诊断的主要内容-Main contents of TCM diagnosis.mp4;0.4-中医诊断的基本原理-Basic principles of TCM diagnosis.mp4;0.5-中医诊断的基本原则-The basic principles of TCM diagnosis.mp4;0.6-望诊概念、方法及内容-Concept, method and content of inspection.mp4;1-望诊-Visitation;1.1.1-望神的概念、原理及意义-The Concept, Principle and Significance of Watching God.mp4;1.1.2-望神的主要内容-Main contents of looking at God.mp4;1.1.3-得神的判断及意义-Judgment and Significance of Deity.mp4;1.1.4-失神的判断及意义-Judgment and significance of absence.mp4;1.1.5-神乱的特征与意义-The characteristics and significance of divine chaos.mp4;1.1.6-望神的注意事项-Precautions for looking at God.mp4;1.1.7-望色的概念-Concept of color.mp4;1.1.8-常色病色-Normal diseased color.mp4;1.1.9-望色的原理和意义-Principle and significance of color viewing.mp4;1.1.10-青色主病-Cyanosis major disease.mp4;1.1.11-赤色主病-Red main disease.mp4;1.1.12-黄色主病-Yellow main disease.mp4;1.1.13-白色主病-White main disease.mp4;1.1.14-黑色主病-Black main disease.mp4;1.1.15-望色十法-Ten methods of looking at colors.mp4;1.1.16-望色注意事项-Precautions for color.mp4;1.1.17-望形概念原理意义-Meaning of the concept of shape.mp4;1.1.18-望形内容-Look at the content.mp4;1.1.19-望态概念原理意义-The meaning of the concept of expectation state.mp4;1.1.20-望态内容1-Content of expectation1.mp4;1.1.21-望态内容2-Content of expectation 2.mp4;1.2.1-局部望诊-Local inspection.mp4;1.2.2-局部望诊中的目形、目态 咽喉-Eye and eye pharynx in local inspection.mp4;1.2.3-望皮肤-Look at the skin.mp4;1.2.4-望皮肤病症-Look for skin disease.mp4;1.3.1-望舌的原理-Principle of tongue observation.mp4;1.3.2-望舌的方法-Method of tongue observation.mp4;1.3.3-舌诊内容-Contents of tongue examination.mp4;1.3.4-正常舌象-Normal tongue.mp4;1.3.5-淡白舌-Pale tongue.mp4;1.3.6-红舌-Red tongue.mp4;1.3.7-绛舌-Crimson tongue.mp4;1.3.8-青紫舌-Bluish tongue.mp4;1.3.9-老嫩舌-Old and tender tongue.mp4;1.3.10-胖瘦舌-Fat and thin tongue.mp4;1.3.11-裂纹舌-Crack tongue.mp4;1.3.12-望舌下络脉-Look at the sublingual collaterals.mp4;1.3.13-厚薄苔-Thick and thin moss.mp4;1.3.14-润燥苔-Moisten and dry moss.mp4;1.3.15-白苔-White moss.mp4;1.3.16-黄苔-Yellow moss.mp4;2-闻诊-Auscultation;2.1.1-正常声音-Normal sound.mp4;2.1.2-喑哑与失音-Aphasia.mp4;2.1.3-谵语 郑声-Delirium, Zheng Sheng.mp4;2.1.4-哮喘-Asthma.mp4;2.1.5-咳嗽-Cough.mp4;3-问诊-Inquiries;3.1.1-问诊的意义及方法-Significance and method of consultation.mp4;3.2.1-问诊的内容-Contents of consultation.mp4;3.2.2-现病史、既往史、个人生活史、家族史-Current medical history Previous history Personal life history Family history.mp4;3.3.1-问现在症的要点,及恶寒发热-Ask about the main points of current symptoms and aversion to cold and fever.mp4;3.3.2-但寒不热、但热不寒、寒热往来-Whether it is cold or hot, but not cold or hot.mp4;3.3.3-问汗-Ask for sweat.mp4;3.3.4-问疼痛的性质-Ask about the nature of pain.mp4;3.3.5-问疼痛的部位-Ask where the pain is.mp4;3.3.6-问头身胸腹-Ask the head, body, chest and abdomen.mp4;3.3.7-问耳目-Ask the eyes and ears.mp4;3.3.8-问睡眠-Ask for sleep.mp4;3.3.9-问饮食的内容 口不渴-Ask about the content of food and drink and be thirsty.mp4;3.3.10-口渴多饮、渴不多饮-Drink too much and not too much.mp4;3.3.11-食欲减退-Loss of appetite.mp4;3.3.12-厌食、胃脘嘈杂-Anorexia and noisy stomach.mp4;3.3.13-消谷善饥、饥不欲食-Relieve hunger and hunger.mp4;3.3.14-偏嗜食物、食量变化和问口味-Preference for food, change in appetite and taste.mp4;3.3.15-便秘-Constipation.mp4;3.3.16-泄泻、便色异常-Diarrhea and abnormal stool color.mp4;3.3.17-便质异常、排便感异常-Abnormal stool quality and feeling.mp4;3.3.18-尿量异常、尿次异常-Abnormal urine volume and urine frequency.mp4;3.3.19-尿色质异常、排尿感异常-Abnormal urine color and sense of urination.mp4;4-切诊-Palpation;4.1.1-脉诊的原理-Principle of pulse diagnosis.mp4;4.1.2-寸口诊脉的基本方法-Basic methods of Cunkou pulse diagnosis.mp4;4.1.3-寸口诊脉的注意事项-Precautions for Cunkou pulse diagnosis.mp4;4.1.4-寸口诊脉的基本原理-Basic principle of cunkou pulse diagnosis.mp4;4.1.5-脉象八要素-Eight Elements of Pulse.mp4;4.1.6-正常脉象-Normal pulse.mp4;4.1.7-浮脉-Floating pulse.mp4;4.1.8-浮脉的相类脉-Facsimile veins of floating veins.mp4;4.1.9-望小儿指纹-Look for children's fingerprints.mp4;4.1.10-沉脉-Sinking pulse.mp4;4.1.11-沉脉的相类脉-Similar pulse of sinking pulse.mp4;4.1.12-迟脉-Delayed pulse.mp4;4.1.13-数脉-Numerous pulse.mp4;4.1.14-弦脉-String pulse.mp4;5-八纲辨证-Syndrome differentiation of eight principles;5.1-八纲辨证导论-Introduction.mp4;5.2.1-八纲的概念及源流-The concept and origin of the eight principles.mp4;5.2.2-表里辩证及表证-Syndrome differentiation between exterior and interior and exterior.mp4;5.2.3-里证及半表半里证-Internal certificate and half external certificate.mp4;5.2.4-寒证-Cold syndrome.mp4;5.2.5-热证及寒证热证的鉴别要点-Differentiation points of heat syndrome and cold syndrome.mp4;5.2.6-虚实辩证及实证-Syndrome differentiation of deficiency and excess and evidence.mp4;5.2.7-虚症及虚实证的鉴别要点- Key points for differentiation of deficiency syndrome and deficiency excess syndrome.mp4;5.2.8-阴证及阴阳辩证 阳证及阴阳鉴别要点-Yin Syndrome, Yin Yang Dialectics, Yang Syndrome and Key Points of Yin Yang Differentiation.mp4;5.2.9 -八纲证候间的关系及证候相兼-The relationship between the eight principles and syndromes and the combination of them.mp4;5.2.10-八纲证候间的关系之症候错杂-The relationship between the eight principles and syndromes and the confusion of syndromes.mp4;5.2.11-证候转化之——表里出入-Transformation of syndromes —— exterior and interior entry and exit.mp4;5.2.12 -寒热、虚实转化-Transformation of cold and heat, deficiency and excess.mp4;5.2.13-八纲辨证的意义-Significance of syndrome differentiation of eight principles.mp4;6-病性辨证-Syndrome differentiation of disease nature;6.1.1-风淫证-Wind lewdness syndrome.mp4;6.1.2-寒淫证-Cold Yin Syndrome.mp4;6.2.1-阳虚证-Yang deficiency syndrome.mp4;6.2.2-阴虚证-Yin deficiency syndrome.mp4;6.2.3-亡阳证与亡阴证-Death of Yang and Yin.mp4;6.3.1-气虚证-Qi deficiency syndrome.mp4;6.3.2-气陷证-Air entrapment syndrome.mp4;6.3.3-气不固证-Qi deficiency syndrome.mp4;6.3.4-血虚证与血脱证-Blood deficiency syndrome and blood withdrawal syndrome.mp4;6.3.5-血瘀证-Blood Stasis Syndrome.mp4;6.3.6-气滞证-Qi stagnation syndrome.mp4;6.3.7-气逆与气闭症-Qi inversion and qi stagnation.mp4;6.4.1-津液亏虚证-Syndrome of body fluid deficiency.mp4;6.4.2-痰证-Phlegm syndrome.mp4;7-病位辨证(脏腑辨证)-Disease location differentiation (viscera differentiation);7.1.1-心病总论与心血虚-General Theory of Heart Disease and Deficiency of Heart Blood.mp4;7.1.2-心阴虚心气虚-Heart Yin Deficiency, Heart Qi Deficiency.mp4;7.1.3-心阳虚 心阳虚脱证-Heart Yang Deficiency Syndrome Removal.mp4;7.1.4-心火亢盛证-Syndrome of hyperactivity of heart fire.mp4;7.1.5-心脉痹阻证-Heart Vessel Obstruction Syndrome.mp4;7.1.6-痰蒙心神证-Syndrome of phlegm obstructing mind.mp4;7.1.7-痰火扰神证 瘀阻脑络证- Syndrome of phlegm fire disturbing spirit syndrome of blood stasis blocking brain collaterals.mp4;7.2.1-肺气虚证-Lung Qi Deficiency Syndrome.mp4;7.2.2-肺阴虚证-Lung Yin Deficiency Syndrome.mp4;7.2.3-风寒犯肺证-Syndrome of wind cold attacking lung.mp4;7.2.4-风热犯肺证-Syndrome of wind heat invading the lung.mp4;7.2.5-燥邪犯肺证-Pathogenic dryness offends the lungs.mp4;7.2.6-肺热炽盛证-Syndrome of hyperactivity of lung heat.mp4;7.2.7-痰热壅肺证-Syndrome of phlegm heat obstructing the lung.mp4;7.2.8-寒痰阻肺证-Syndrome of cold phlegm obstructing lung.mp4;7.2.9-饮停胸胁证-Syndrome of stopping drinking and chest and hypochondriasis.mp4;7.2.10-风水搏肺证-Syndrome of Feng Shui Beating the Lung.mp4;7.3.1-脾胃总论与脾气虚证-General Theory of Spleen and Stomach and Spleen Qi Deficiency Syndrome.mp4;7.3.2-脾虚气陷证-Syndrome of spleen deficiency and qi depression.mp4;7.3.3-脾阳虚证-Spleen Yang Deficiency Syndrome.mp4;7.3.4-脾不统血证-Syndrome of spleen not controlling blood.mp4;7.3.5-湿热蕴脾证-Syndrome of dampness heat accumulating in the spleen.mp4;7.3.6-寒湿困脾证-Cold dampness and spleen stagnation syndrome.mp4;7.4.1-总论和肝血虚证-General and liver blood deficiency syndrome.mp4;7.4.2-肝阴虚证-Liver Yin Deficiency Syndrome.mp4;7.4.3-肝郁气滞证-Liver qi stagnation syndrome.mp4;7.4.4-肝火炽盛证-Syndrome of liver fire.mp4;7.4.5-肝阳上亢证-Hyperactivity of liver yang.mp4;7.4.6-肝风内动证-Syndrome of internal movement of liver wind.mp4;7.4.7-寒凝肝脉证-Syndrome of cold congealing liver pulse.mp4;7.5.1-肾阳虚证-Kidney Yang Deficiency Syndrome.mp4;7.5.2-肾虚水泛证-Syndrome of kidney deficiency and water flooding.mp4;7.5.3-肾阴虚证-Kidney yin deficiency syndrome.mp4;7.5.4-肾精不足证-Syndrome of insufficient kidney essence.mp4;7.5.5-肾气不固证-Syndrome of kidney qi deficiency.mp4;7.5.6-肾不纳气证-Syndrome of kidney failing to absorb qi.mp4;7.6.1-心肾不交证-Heart kidney non delivery.mp4;7.6.2-肝胃不和证-Syndrome of disharmony between liver and stomach.mp4;7.6.3-肝郁脾虚证-Liver depression and spleen deficiency syndrome.mp4;7.6.4-肝胆湿热证-Liver and gallbladder damp heat syndrome.mp4;7.6.5-肝肾阴虚证-Liver and kidney yin deficiency syndrome.mp4;7.6.6-脾肾阳虚证-Spleen and kidney yang deficiency syndrome.mp4;8-实训-Practical Training;8.1-中医脉诊实训-Practical Training of Pulse Diagnosis of Traditional Chinese Medicine.mp4";
  375. break;
  376. case 'zhongyaojianding':
  377. $files = "1-绪论-Introduction;1.1.1-中药鉴定学的定义-Definition of TCM identification.mp4;1.2.1-中药品种的考证与整理-Research and arrangement of traditional Chinese medicine varieties.mp4;1.2.2-鉴定中药的真伪优劣-Identification of the authenticity of traditional Chinese medicine.mp4;1.2.3-研究和制定中药质量标准-Research and formulate quality standards for traditional Chinese medicine.mp4;1.2.4-寻找和扩大新药源-Finding and expanding new drug sources.mp4;2-中药鉴定学的发展史-Development history of TCM identification;2.1.1-中药鉴定学的发展史-Development history of TCM identification.mp4;3-中药的采收和产地加工-Collection and processing of traditional Chinese medicine;3.1.1-道地药材的定义-Definition of genuine medicinal materials.mp4;3.1.2-道地药材的特点及形成机制-Characteristics and formation mechanism of genuine medicinal materials.mp4;3.2.1-中药适宜采收期确定的一般原则-中药适宜采收期确定的一般原则.mp4;3.2.2-中药采收的一般规律-General rules of traditional Chinese medicine collection.mp4;3.3.1-产地加工的意义-Significance of processing at the place of origin.mp4;3.3.2-产地加工的方法-Processing method at the place of origin.mp4;3.4.1-中药的贮藏-Storage of traditional Chinese medicine.mp4;3.4.2-中药贮藏保管和变质防治-Storage, preservation and deterioration prevention of traditional Chinese medicine.mp4;4-中药鉴定-Identification of traditional Chinese medicine;4.1.1-中药鉴定的依据和程序-Basis and procedure for identification of traditional Chinese medicine.mp4;4.2.1-来源鉴定-Source identification.mp4;4.2.2-性状鉴定-Character identification.mp4;4.2.3-显微鉴定-Microscopic identification.mp4;4.2.4-理化鉴定(上)-Physical and chemical identification (I).mp4;4.2.5-理化鉴定(下)-Physical and chemical identification (II).mp4;4.2.6-生物鉴定-Biological identification.mp4;5-根及根茎类中药-Roots and rhizomes;5.1.1-根及根茎类中药-Roots and rhizomes.mp4;5.1.2-根茎类中药-Rhizome traditional Chinese medicine.mp4;5.2.1-绵马贯众-Mianma Guanzhong.mp4;5.2.2-大黄-Rhubarb.mp4;5.2.3-何首乌-Polygonum multiflorum.mp4;5.2.4-牛膝 川牛膝-Achyranthes bidentata.mp4;5.2.5-川乌、附子、草乌-Radix Aconiti, Radix Aconiti, Radix Aconiti.mp4;5.2.6-白芍 赤芍-White peony and red peony.mp4;5.2.7-黄连-Coptis chinensis.mp4;5.2.8-防己-Self defense.mp4;5.2.9-板蓝根-Banlangen.mp4;5.2.10-甘草-Licorice.mp4;5.2.11-黄芪- Astragalus membranaceus.mp4;5.2.12-人参-Ginseng.mp4;5.2.13-西洋参-American Ginseng.mp4;5.2.14-三七- Panax notoginseng.mp4;5.2.15 -川芎- Ligusticum chuanxiong.mp4;5.2.16-防风-windproof.mp4;5.2.17-柴胡-Bupleurum chinense.mp4;5.2.18-白芷-Angelica dahurica.mp4;5.2.19-前胡-Qianhu.mp4;5.2.20-丹参-Salvia miltiorrhiza.mp4;5.2.21-黄芩-Scutellaria baicalensis.mp4;5.2.22-地黄- Rehmannia glutinosa.mp4;5.2.23-半夏- Pinellia ternate.mp4;5.2.24-天南星- Arisaema.mp4;5.2.25-山药- Yam.mp4;5.2.26-川贝母- Fritillaria thunbergii.mp4;5.2.27-麦冬- Ophiopogon japonicus.mp4;5.2.28-天麻- Gastrodia elata.mp4;6-茎木类中药-Stems and trees;6.1.1-茎木类中药鉴别特征-Identification characteristics of stems and trees.mp4;6.2.1-鸡血藤大血藤-Caulis spatholobi and Caulis spatholobi.mp4;6.2.2-沉香- Chenxiang.mp4;7-皮类中药-Dermata TCD;7.1.1-皮类中药概述-Overview of skin traditional Chinese medicine.mp4;7.1.2-皮类中药鉴别特征- Identification characteristics of traditional Chinese medicine for skin.mp4;7.2.1-桑白皮-Mulberry white.mp4;7.2.2-黄柏-Phellodendron chinense.mp4;7.2.3-关黄柏-Guan Huangbai.mp4;7.2.3-厚朴-Houpu.mp4;7.2.5-肉桂-Cinnamon.mp4;7.2.6-杜仲-DuZhong.mp4;7.2.7-牡丹皮-Peony bark.mp4;8-叶类中药-leaf traditional Chinese medicine;8.1-叶类中药鉴别特征-Identification characteristics of leaf type traditional Chinese medicine.mp4;8.2.1-大青叶、艾叶- Folium Isatidis and Artemisia argyi.mp4;8.2.2-番泻叶- Senna.mp4;9-花类中药-Flowers;9.1.1-花类中药鉴别特征 -Identification characteristics of flowers.mp4;9.2.1 -辛夷-Magnolia.mp4;9.2.2 -丁香 - Cloves.mp4;9.2.3-金银花- Honeysuckle.mp4;9.2.4-红花- Safflower.mp4;9.2.5-槐花- Sophora japonica.mp4;9.2.6-西红花- Saffron.mp4;10-果实及种子类中药-Fruits and seeds;10.1.1-果实及种子类中药鉴别- Identification of fruits and seeds of traditional Chinese medicine.mp4;10.2.1-五味子-Schisandra chinensis.mp4;10.2.2-苦杏仁- Bitter Almond.mp4;10.2.3-陈皮、巴豆- Orange peel, croton.mp4;10.2.4-砂仁- Amomum villosum.mp4;11-全草类中药-Herbal Chinese Medicine;11.1.1-全草类中药概述-Overview of whole herb Chinese medicine.mp4;11.2.1-麻黄- Ephedra.mp4;11.2.2-槲寄生- Mistletoe.mp4;11.2.3-薄荷- Mint.mp4;11.2.4-肉苁蓉- Cistanche deserticola.mp4;11.2.5-青蒿- Artemisia annua.mp4;12-藻菌地衣-Algae bacteria lichen;12.1.1-藻菌地衣概述- Overview of algal and bacterial lichens.mp4;12.2.1-冬虫夏草- Cordyceps sinensis.mp4;12.2.2-灵芝- Ganoderma lucidum.mp4;12.2.3-茯苓- Poria cocos.mp4;13-树脂类 - Resins;13.1.1-树脂类中药鉴别特征概述- Overview of identification characteristics of resin based traditional Chinese medicine.mp4;13.2.1-树脂类中药血竭 - Resinous Dragon's Blood.mp4;14-其他类中药-Other traditional Chinese medicine;14.1.1-其他类中药概述 - Overview of other traditional Chinese medicines.mp4;14.2.1-青黛- Indigo Naturalis.mp4;14.2.2-冰片- Borneol.mp4;14.2.3-五倍子 - Galla Chinensis.mp4;15-动物类中药研究与鉴定-Research and identification of animal traditional Chinese medicine;15.1.1-动物类中药的应用与研究-Application and research of animal traditional Chinese medicine.mp4;15.2.1-动物类中药的分类与鉴定- Classification and identification of animal traditional Chinese medicine.mp4;16-动物类中药-Animal traditional Chinese medicine;16.1.1-全蝎-Scorpion.mp4;16.1.2-桑螵蛸- Cuttlebone.mp4;16.1.3-海马- Hippocampus.mp4;16.1.4-珍珠- Pearl.mp4;16.1.5-金钱白花蛇- Golden Snake.mp4;16.1.6-蕲蛇- Agkistrodon acutus.mp4;16.1.7-麝香- Musk.mp4;16.1.8-牛黄- Bezoar.mp4;16.1.9-羚羊角 - Antelope horn.mp4;17- 矿物类中药-Mineral Traditional Chinese Medicine;17.1.1 - 矿物类中药概述- Overview of mineral traditional Chinese medicine.mp4;17.2.1-朱砂- vermilion.mp4;17.2.2-雄黄- Realgar.mp4;17.2.3-石膏- Gypsum.mp4;17.2.4-自然铜-Native copper.mp4";
  378. break;
  379. case 'zhongji-zh':
  380. $files = "1-中医基础理论介绍;1.1.1-国之瑰宝 中国医学.mp4;1.1.2-B中医学的学科属性.mp4;1.1.3- 走进《中医基础理论》.mp4;1.1.4-中医学理论体系的内涵.mp4;1.1.5-中华医药 源远流长—形成.mp4;1.1.6-四大经典 奠基中医.mp4;1.1.7-传承创新 代有发展—魏晋隋唐时期.mp4;1.1.8-传承创新 代有发展—宋金元时期 1.mp4;1.1.9-B传承创新 代有发展--宋金元时期 2.mp4;1.1.10-传承创新 代有发展—明清时期.mp4;1.1.11-传承创新 代有发展—近代与现代.mp4;1.2.1-B整体观念:生理的整体观.mp4;1.2.2-整体观念,病机上的整体观.mp4;1.2.3-B整体观念,诊治上的整体观.mp4;1.2.4-人与自然的整体性——季节气候与生理病理.mp4;1.2.5-人与自然的整体性——昼夜时辰 地域环境与生理病理.mp4;1.2.6-人与自然的整体性——疾病防治与自然环境的关系.mp4;1.2.7-人与社会环境的统一性.mp4;1.2.8-C辨证论治——症、证、病的概念与关系.mp4;1.2.9-辨证论治——辨证论治的概念以及运用1.mp4;1.2.10-C辨证论治——辨证论治的概念以及运用2.mp4;1.3.1-中医学的主要思维方式——象思维.mp4;1.3.2-中医学的主要思维方式——系统思维 变易思维.mp4;1.3.3-中医学的主要思维方式——变易思维 中和思维.mp4;2-气、阴阳、五行;2.1.1-A一气的原始概念哲学概念.mp4;2.1.2-B一气的原始概念哲学概念.mp4;2.1.3-C一气的原始概念哲学概念.mp4;2.1.4-A气是天地万物相互联系的中介 2021.4.26修改.mp4;2.2.1-阴阳的概念与形成.mp4;2.2.2-A阴阳的特性与归类.mp4;2.2.3-阴阳对立.mp4;2.2.4-阴阳互根.mp4;2.2.5-阴阳交感.mp4;2.2.6-阴阳消长.mp4;2.2.7-阴阳转化.mp4;2.2.8-阴阳学说的基本内容(六)阴阳自和.mp4;2.2.9-人生有形,不离阴阳.mp4;2.2.10-察色按脉,先别阴阳.mp4;2.2.11-防治疾病,必和阴阳.mp4;2.3.1-五行的概念与形成.mp4;2.3.2-五行的特性与归类.mp4;2.3.3-五行学说的基本内容(一)五行相生.mp4;2.3.4-五行学说的基本内容(二)五行相克.mp4;2.3.5-五行制化与胜复.mp4;2.3.6-C五行相乘、相侮及母子相及.mp4;2.3.7-五行学说在中医学中的应用(一).mp4;2.3.8-五行学说在中医学中的应用(二).mp4;2.3.9-B指导疾病的诊断和治疗.mp4;3-藏相;3.1.1-藏象的概念.mp4;3.1.2-C以表知里,司外揣内.mp4;3.1.3-藏象学说的形成.mp4;3.1.4-脏腑分类及各自生理特点.mp4;3.1.5-藏象学说的特点及学习方法特点.mp4;3.2.1-心主血脉的概念与条件.mp4;3.2.2-A心主血脉的生理和病理1.mp4;3.2.3-心主血脉的生理和病理2.mp4;3.2.4-心主神明1.mp4;3.2.5-心主神明2.mp4;3.2.6-心的特性.mp4;3.2.7-心联属1.mp4;3.2.8-心联属2.mp4;3.2.9-心在窍为舌,心在液为汗.mp4;3.2.10-心应夏,心包络.mp4;3.2.11-肺的概述与特性.mp4;3.2.12-肺主气司呼吸.mp4;3.2.13-肺主一身之气,通调水道.mp4;3.2.14-通调水道2.mp4;3.2.15-肺朝百脉,主治节.mp4;3.2.16-肺藏魄 肺在志为忧(悲).mp4;3.2.17-D肺在体合皮,其华在毛.mp4;3.2.18-肺在窍为鼻,喉为肺之门户在液为涕肺应秋.mp4;3.2.19-D脾运化食物.mp4;3.2.20-运化食物2.mp4;3.2.21-运化水液、喜燥恶湿.mp4;3.2.22-脾的特性-脾气宜升.mp4;3.2.23-脾统血.mp4;3.2.24-系统联系1.mp4;3.2.25-系统联系2.mp4;3.2.26D-肝1—概述与特性_1只修过2次,应该是B为了与上传好认.mp4;3.2.27-肝主疏泄概念及病机.mp4;3.2.28-肝主疏泄的生理作用1.mp4;3.2.29-肝主疏泄的生理作用2.mp4;3.2.30-肝5肝藏血1.mp4;3.2.31-肝6肝藏血2.mp4;3.2.32-肝7肝藏魂.mp4;3.2.33-肝8 体华窍液时.mp4;3.2.34-肾的概述、肾藏精的概念.mp4;3.2.35-肾藏精—主生长发育与生殖.mp4;3.2.35-A肾藏精-主生长发育与生殖.mp4;3.2.36-肾藏精,主脏腑气化等.mp4;3.2.37-肾藏精,主生髓化血、主抵御外邪.mp4;3.2.38-肾主水.mp4;3.2.39-肾主纳气.mp4;3.2.40-肾藏志、在志为恐、在体合骨、荣齿、其华在发.mp4;3.2.41-肾在窍为耳及二阴.mp4;3.2.42-系统联系3.mp4;3.3.1-六腑的概念、生理功能及特点.mp4;3.3.2-胆的生理功能.mp4;3.3.3-胃的概念及生理功能.mp4;3.3.4-小肠、大肠.mp4;3.3.5-膀胱、三焦.mp4;3.4.1-奇恒之腑的概念及特点.mp4;3.4.2-脑、髓的概述及功能.mp4;3.4.3-女子胞的概述及生理功能.mp4;3.5.1-心与它脏的关系.mp4;3.5.2-A肺与它脏的关系.mp4;3.5.3-肝与它脏的关系.mp4;3.5.4-脾与它脏的关系.mp4;3.5.5-腑与腑之间的关系.mp4;3.6.1-脏与腑的关系前言.mp4;3.6.2-心与小肠的关系.mp4;3.6.3-肺与大肠的关系.mp4;3.6.4-脾与胃的关系.mp4;3.6.5-肝与胆的关系.mp4;3.6.6-肾与膀胱的关系.mp4;4-精气血津液;4.1.1-人体之精的概念与分类1.mp4;4.1.2-人体之精的生成、贮藏和施泄2.mp4;4.1.3-人体之精的功能3.mp4;4.2.1-人体之气的概念.mp4;4.2.2-人体之气的生成.mp4;4.2.3-人体之气的运动——气机.mp4;4.2.4-气机失常的表现与气化.mp4;4.2.5-人体之气功能之——推动、温煦.mp4;4.2.6-人体之气功能之——防御、固摄、中介.mp4;4.2.7-元气.mp4;4.2.8-宗气.mp4;4.2.9-营气、卫气.mp4;4.3.1-血的概念与生成1.mp4;4.3.1-A血的概念与生成.mp4;4.3.2-血的运行与功能.mp4;4.4.1-A津液的概念和输布.mp4;4.4.2-津液的排泄与功能.mp4;4.5.1-神的概念、分布与功能.mp4;4.6.1-气与血的关系.mp4;4.6.2-气与津液的关系.mp4;4.6.3-B精血、津液和精气的关系.mp4;5- 经络;5.1.1-经络概念.mp4;5.1.2-经络系统.mp4;5.2.1-A十二经脉的名称和走向交接规律.mp4;5.2.2-分布、表里和气血流注.mp4;5.3.1-奇经八脉.mp4;5.3.2-奇经八脉2.mp4;5.3.3-A奇经八脉各自的生理功能2.mp4;5.4.1-经络的生理功能.mp4;5.4.2-A经络学说的应用.mp4;6-体质;6.1.1-体质的概念.mp4;6.1.1-A体质的概念.mp4;6.1.2-体质的特点.mp4;6.1.2-A体质的特点.mp4;6.2.1-体质的基础与成因.mp4;6.2.1-A体质的基础与成因.mp4;6.3.1-阴阳分类.mp4;6.3.1-A阴阳分类.mp4;6.3.2-气虚质.mp4;6.3.2-A气虚质.mp4;6.3.3-阳虚质.mp4;6.3.3-A阳虚质.mp4;6.3.4-阴虚质.mp4;6.3.4-A阴虚质.mp4;6.3.5-湿热质.mp4;6.3.5-A湿热质.mp4;6.3.6-血瘀质.mp4;6.3.6-A血瘀质.mp4;6.3.7-气郁质.mp4;6.3.7-A气郁质.mp4;6.3.8-痰湿质.mp4;6.3.8-A痰湿质.mp4;6.4.1-体质学说的应用.mp4;6.4.1-A体质学说的应用.mp4;7-病因;7.1.1-A病因概述.mp4;7.1.1-D病因概述.mp4;7.1.2-A六淫的概念.mp4;7.1.3-D六淫致病的共同致病特点-改.mp4;7.1.4-A风邪(一).mp4;7.1.5-A风邪(二).mp4;7.1.6-C风邪(三).mp4;7.1.7-A寒邪.mp4;7.1.8-A暑性升散,伤津耗气.mp4;7.1.9-A湿邪(一).mp4;7.1.10-A湿邪(二).mp4;7.1.11-A燥胜则干,津伤肺燥.mp4;7.1.12-C火邪(一).mp4;7.1.13-A火邪(二).mp4;7.1.14-C火邪(三).mp4;7.1.15-C疠气致病特点.mp4;7.1.16-A疠气发病的影响因素.mp4;7.2.1-B七情过激直接伤及内脏.mp4;7.2.2-B七情致病影响脏腑气机(一).mp4;7.2.3-B七情致病影响脏腑气机(二).mp4;7.2.4-B情绪是把双刃剑.mp4;7.2.5-B饮食不节与不洁,成疾致危.mp4;7.2.6-B饮食偏嗜,阴阳失调.mp4;7.2.7-B积“劳”成疾(一).mp4;7.2.8-B积“劳”成疾(二).mp4;7.2.9-B过“逸”致疾(一).mp4;7.2.10-B过“逸”致疾(二).mp4;7.3.1-B痰饮的形成(一).mp4;7.3.2-B痰饮的形成(二).mp4;7.3.3-B痰饮的致病特点(一).mp4;7.3.4-B痰饮的致病特点(二).mp4;7.3.5-B瘀血的形成(一).mp4;7.3.6-B瘀血的形成(二).mp4;7.3.7-B瘀血致病特点(一).mp4;7.3.8-B瘀血致病特点(二).mp4;7.3.9-B结石致病.mp4;8-病机;8.1.1-病机概述.mp4;8.1.2-正虚邪侵与疾病发生.mp4;8.1.3-影响发病的主要因素.mp4;8.1.4-发病类型.mp4;8.2.1-邪正盛衰与虚实变化.mp4;8.2.2-邪正盛衰与疾病转归.mp4;8.2.3-阴阳偏胜与偏衰.mp4;8.2.4-阴阳互损与格拒.mp4;8.2.5-阴阳转化与亡失.mp4;8.2.6-精的失常.mp4;8.2.7-气的失常.mp4;8.2.8-血的失常.mp4;8.2.9-精气血关系的失调.mp4;8.2.10-精气血津液失常.mp4;8.2.10-A精气血津液失常.mp4;8.3.1-内生五邪之风气内动.mp4;8.3.1-A内生五邪之风气内动.mp4;8.3.2-内生五邪之寒从中生与湿浊内生.mp4;8.3.3-C内生五邪之津伤化燥与火热内生.mp4;8.3.3-D内生五邪之津伤化燥与火热内生.mp4;8.4.1-疾病传变的形式.mp4;8.4.2-影响疾病传变的因素.mp4;9-养生与防治原则;9.1.1-养生与天年.mp4;9.1.2-衰老及原因.mp4;9.1.3-养生的基本原则.mp4;9.2.1-治未病总论.mp4;9.2.2-未病先防 扶正辟邪.mp4;9.2.3-既病防变,愈后防复.mp4;9.3.1-治则总论-治病求本.mp4;9.3.2-逆者正治,从者反治.mp4;9.3.3-标本缓急、分清主次.mp4;9.3.4-扶正祛邪、灵活运用.mp4;9.3.5-B调整阴阳、以平为期_2020.10.25改.mp4;9.3.6-调和脏腑1——五行相生、补母泻子.mp4;9.3.7-调和脏腑2——五行相克、抑强扶弱.mp4;9.3.8-三因制宜、辨证治疗.mp4";
  381. break;
  382. case 'zhongji-en':
  383. $files = "0-preface;0-Preface of Learing(序言).mp4;0.1-Basic Theory of Traditional Chinese Medicine.mp4;1- Introduction;1.1-Breif History of TCM Theory System.mp4;1.2-Wholism Concep.mp4;1.3-Treatment Based on Syndrome Differentiation.mp4;2- Yin Yang and Five Elements;2.1-Concept and Theory Contents of Yin-Yang.mp4;2.2- Application of Yin-Yang Theory in Chinese Medicine.mp4;2.3- Notion of the Five Elements.mp4;2.4-Application of the Five Elements Theory in Chinese Medicine.mp4;3-Tibetan, Heart;3.1-Visceral Picture Theory Overview.mp4;3.2-The Heart.mp4;3.3-The Lung.mp4;3.4-The Spleen.mp4;3.5-The Liver.mp4;3.6-The Kidney.mp4;3.7-The Six Fu Organs.mp4;4-Spirit, Qi, Blood, Body Fluid and Spirit;4.1- Qi.mp4;4.2-The Blood.mp4;4.3- Body Fluid.mp4;4.4- Relationships among Qi, Blood, and Body Fluid.mp4;5-Meridians;5.1-Overview of the Meridian System.mp4;5.2- The Twelve Meridians.mp4;5.3-The Eight Extraordinary Meridians.mp4;6-Constitution;6.0-Constitution Theory.mp4;7-Etiology;7.1- Etiology Introduction.mp4;7.2- Wind Pathogen.mp4;7.3- Cold Pathogen.mp4;7.4-Summer-heat Pathogen.mp4;7.5- Dampness Pathogen.mp4;7.6- Dryness Pathogen.mp4;7.7- Fire Pathogen.mp4;7.8-Pestilent Pathogens.mp4;7.9- Endogenous Seven Affects.mp4;7.10-Improper Diet and Maladjustment of Work and Leisure.mp4;7.11-Phlegm and Stagnant Fluid.mp4;7.12-Stagnant Blood.mp4;8-Pathogenesis;8.1- Basic Pathogenesis I.mp4;8.2-Basic Pathogenesis II.mp4;9-Prevention and treatment principles;9.1-Principles for Prevention of Disease.mp4;9.2-Principles for Treatment of Disease.mp4";
  384. break;
  385. }
  386. $filesInFolder = str2arr($files, ';');
  387. foreach ($filesInFolder as $path) {
  388. $file = pathinfo($path);
  389. $video = [
  390. 'section' => 0,
  391. 'video' => false,
  392. 'video_path' => false,
  393. 'srt' => false,
  394. ];
  395. if (array_key_exists('extension', $file)) {
  396. $this->line($file['filename']);
  397. switch (strtolower($file['extension'])) {
  398. case 'txt':
  399. $file_data = str2arr0($file['filename'], '-');
  400. $name = $file_data[1];
  401. if ($base_lang == 'en') $name = $file_data[2];
  402. $sections[$file_data[0]] = [
  403. 'name' => $name,
  404. 'en_name' => $file_data[2],
  405. ];
  406. break;
  407. case 'mp4':
  408. $file_data = str2arr0($file['filename'], '-');
  409. if (count($file_data) == 2) {
  410. list($index, $name
  411. ) = str2arr0($file['filename'], '-');
  412. $s = str2arr0($index, '.');
  413. $en_name = $name;
  414. } else {
  415. list($index, $name, $en_name) = str2arr0($file['filename'], '-');
  416. $s = str2arr0($index, '.');
  417. if ($base_lang == 'en') $name = $en_name;
  418. }
  419. $videos[$s[0]][] = [
  420. 'section' => $s[0],
  421. 'name' => $name,
  422. 'en_name' => $en_name,
  423. 'path' => "{$base_url}/" . $file['filename'] . '.mp4',
  424. 'srt' => false
  425. ];
  426. break;
  427. case 'srt':
  428. break;
  429. }
  430. } else {
  431. $file_data = str2arr0($file['filename'], '-');
  432. $name = $file_data[1];
  433. if (count($file_data) == 2) {
  434. $sections[$file_data[0]] = [
  435. 'name' => $name,
  436. 'en_name' => $file_data[1],
  437. ];
  438. } else {
  439. if ($base_lang == 'en') $name = $file_data[2];
  440. $sections[$file_data[0]] = [
  441. 'name' => $name,
  442. 'en_name' => $file_data[2],
  443. ];
  444. }
  445. }
  446. }
  447. // dd($videos[0]);
  448. // print_r($videos);
  449. // $this->table(['section', 'name', 'en_name', 'path', 'srt'], $videos);
  450. // $this->table(array_keys($videos[0]), $videos);
  451. //dd(1);
  452. // return false;
  453. if ($base_course_id) {
  454. $course = Course::query()->find($base_course_id);
  455. } else {
  456. $course = Course::query()->create([
  457. 'title' => $title,
  458. 'language' => $base_lang,
  459. 'admin_id' => 1,
  460. 'status' => 1,
  461. 'slug' => Str::random(8),
  462. 'published_at' => Carbon::now()->toDateTimeString(),
  463. ]);
  464. }
  465. Chapter::query()->where('course_id', $course->id)->delete();
  466. Video::query()->where('course_id', $course->id)->delete();
  467. DB::beginTransaction();
  468. try {
  469. foreach ($videos as $s => $vs) {
  470. $section = false;
  471. if ($is_close_chapter) {
  472. $section = $sections[1];
  473. } else {
  474. $section = $sections[$s];
  475. }
  476. $chapter = Chapter::query()->updateOrCreate([
  477. 'course_id' => $course->id,
  478. 'title' => $section['name'],
  479. 'language' => $base_lang,
  480. ], [
  481. 'status' => ModelStatusEnum::OK
  482. ]);
  483. foreach ($vs as $video) {
  484. $resource = Resource::query()->updateOrCreate([
  485. 'name' => $video['name'],
  486. 'original_name' => $video['name'],
  487. 'path' => $video['path'],
  488. ], [
  489. 'disk' => 'qiniu',
  490. 'url' => $video['path'],
  491. 'size' => 0,
  492. 'language' => $base_lang,
  493. 'status' => ModelStatusEnum::OK,
  494. ]);
  495. $subtitle_resource = null;
  496. if ($video['srt']) {
  497. $subtitle_resource = Resource::query()->updateOrCreate([
  498. 'path' => $video['srt']['path'],
  499. ], [
  500. 'name' => Str::random(8) . '.srt',
  501. 'original_name' => $video['srt']['name'],
  502. 'disk' => 'public',
  503. 'url' => $video['srt']['path'],
  504. 'size' => 0,
  505. 'language' => $base_lang,
  506. 'status' => ModelStatusEnum::OK,
  507. ]);
  508. }
  509. Video::query()->updateOrCreate([
  510. 'course_id' => $course->id,
  511. 'course_chapter_id' => $chapter->id,
  512. 'title' => $video['name'],
  513. ], [
  514. 'slug' => Str::random(),
  515. 'language' => $base_lang,
  516. 'url' => $resource->id,
  517. 'published_at' => Carbon::now()->toDateTimeString(),
  518. 'subtitle_zh_path' => $subtitle_resource ? $subtitle_resource->id : '',
  519. 'subtitle_en_path' => $subtitle_resource ? $subtitle_resource->id : '',
  520. 'status' => ModelStatusEnum::OK
  521. ]);
  522. }
  523. }
  524. DB::commit();
  525. } catch (\Exception $exception) {
  526. DB::rollBack();
  527. dd($exception);
  528. }
  529. $this->line('完成');
  530. return true;
  531. }
  532. public function srt2vtt($str)
  533. {
  534. return str_replace('.srt', '.vtt', $str);
  535. }
  536. public function number($str)
  537. {
  538. return preg_replace('/[^\.0123456789]/s', '', $str);
  539. }
  540. public function getNumber($str)
  541. {
  542. $arr = explode('-', $str);
  543. return (int)$arr[0] . '.' . (int)$arr[1] . '.' . (int)$arr[2];
  544. }
  545. // public function loadFiles()
  546. // {
  547. //// $base_path = '/home/www/platform-api/storage/app/public/course_video/zhongyililunjichu-en';
  548. //// $base_path = '/Volumes/希梦耐康科技/中医基础理论/中医基础理论';
  549. //// $base_path = '/Volumes/希梦耐康科技/中医基础理论v3-laster';
  550. //// $filesInFolder = File::files($base_path);
  551. //// $videos = [];
  552. //// $i = 0;
  553. //// foreach ($filesInFolder as $path) {
  554. //// $file = pathinfo($path);
  555. //// $video = [
  556. //// 'id' => 0,
  557. //// 'section' => 0,
  558. //// 'video' => false,
  559. //// 'video_path' => false,
  560. //// 'srt' => false,
  561. //// ];
  562. //// if ($file['extension'] == 'mp4') {
  563. ////
  564. //// $video['video'] = $file['filename'] . '.mp4';
  565. //// $video['video_path'] = 'zhongyijichulilun-20220905/' . $file['filename'] . '.mp4';
  566. //// $nums = substr($video['video'], 0, 1);
  567. //// $video['section'] = $nums;
  568. ////// $is_exists = File::exists($base_path . '/' . $file['filename'] . '.srt');
  569. ////// if ($is_exists) {
  570. ////// $video['srt'] = $file['filename'] . '.srt';
  571. ////// $video['srt_path'] = 'course_video/zhongyijichulilun-20220905/' . $file['filename'] . '.srt';
  572. ////// $i++;
  573. ////// }
  574. //// $i++;
  575. //// $video['id'] = count($videos) + 1;
  576. ////// $videos[$nums][] = $video;
  577. //// $videos[] = $video;
  578. //// }
  579. //// }
  580. //// dd(arr2str(array_column($videos, 'video'), '&'));
  581. //// $this->table(['id', 'section', 'name', 'path', 'srt'], $videos);
  582. //// dd(1);
  583. //
  584. //// $s_courses = "《中医基础理论》片花.mp4&0 Preface of Learing(序言).mp4&1.1 Breif History of TCM Theory System(中医理论体系简史).mp4&1.2 Wholism Concept(整体观念).mp4&1.3 Treatment Based on Syndrome Differentiation(辨证论治).mp4&2.1 Concept and Theory Contents of Yin-Yang(阴阳概念及阴阳学说内容).mp4&2.2 Application of Yin-Yang Theory in Chinese Medicine(阴阳学说的应用).mp4&2.3 Notion of the Five Elements(五行概念).mp4&2.4 Application of the Five Elements Theory in Chinese Medicine(五行学说的应用).mp4&3.1 Visceral Picture Theory Overview(藏象概述).mp4&3.2 The Heart(心).mp4&3.3 The Lung(肺).mp4&3.4 The Spleen(脾).mp4&3.5 The Liver(肝).mp4&3.6 The Kidney.mp4&3.7 The Six Fu Organs(六腑).mp4&4.1 Qi(气).mp4&4.2 The Blood(血).mp4&4.3 Body Fluid(津液).mp4&4.4 Relationships among Qi, Blood, and Body Fluid(气血津液的相互关系).mp4&5.1 Overview of the Meridian System(经络学说概述).mp4&5.2 The Twelve Meridians(十二经脉).mp4&5.3 The Eight Extraordinary Meridians(奇经八脉).mp4&6.0 Constitution Theory(体质).mp4&7.1 Etiology Introduction(病因概述).mp4&7.10 Improper Diet and Maladjustment of Work and Leisure(饮食失宜及劳逸失度).mp4&7.11 Phlegm and Stagnant Fluid(痰饮).mp4&7.12 Stagnant Blood(瘀血).mp4&7.2 Wind Pathogen(风邪).mp4&7.3 Cold Pathogen(寒邪).mp4&7.4 Summer-heat Pathogen(暑邪).mp4&7.5 Dampness Pathogen(湿邪).mp4&7.6 Dryness Pathogen(燥邪).mp4&7.7 Fire Pathogen(火邪).mp4&7.8 Pestilent Pathogens(疠气).mp4&7.9 Endogenous Seven Affects(内伤七情).mp4&8.1 Basic Pathogenesis I(病机一).mp4&8.2 Basic Pathogenesis II(病机二).mp4&9.1 Principles for Prevention of Disease(预防).mp4&9.2 Principles for Treatment of Disease(治则).mp4";
  585. //// $courses = [];
  586. ////
  587. //// foreach (str2arr($s_courses, '&') as $key => $course) {
  588. //// $courses[$key]['section'] = is_numeric(substr($course, 0, 1)) ? substr($course, 0, 1) : 0;
  589. //// $courses[$key]['path'] = "zhongyijichulilun-20220905/" . $course;
  590. //// $courses[$key]['name'] = $course;
  591. //// }
  592. ////
  593. //// //创建课程
  594. //// $course = Course::query()->updateOrCreate([
  595. //// 'title' => 'TCM BASIC THEORY',
  596. //// 'language' => 'en',
  597. //// ], [
  598. //// 'status' => ModelStatusEnum::OK
  599. //// ]);
  600. //// //创建章节
  601. ////// $sections = array_unique(array_column($videos, 'section'));
  602. ////// foreach ($videos as $section => $video) {
  603. ////// $chater = Chapter::query()->updateOrCreate([
  604. ////// 'course_id' => $course->id,
  605. ////// 'title' => str_replace('.mp4', '', $video[0]['video']),
  606. ////// 'language' => 'en',
  607. ////// ], [
  608. ////// 'status' => ModelStatusEnum::OK
  609. ////// ]);
  610. ////// foreach ($video as $item) {
  611. //////
  612. ////// $resource = Resource::query()->updateOrCreate([
  613. ////// 'name' => $item['video'],
  614. ////// 'original_name' => $item['video'],
  615. ////// 'path' => $item['video_path'],
  616. ////// ], [
  617. ////// 'disk' => 'qiniu',
  618. ////// 'url' => 'http://zhongma.qiniu.xmnk.cn/' . $item['video_path'],
  619. ////// 'size' => 0,
  620. ////// 'language' => 'en',
  621. ////// 'status' => ModelStatusEnum::OK,
  622. ////// ]);
  623. ////// $subtitle_resource = null;
  624. ////// if ($item['srt']) {
  625. ////// $subtitle_resource = Resource::query()->updateOrCreate([
  626. ////// 'path' => $item['srt'],
  627. ////// ], [
  628. ////// 'name' => Str::random(8) . '.srt',
  629. ////// 'original_name' => $item['srt'],
  630. ////// 'disk' => 'public',
  631. ////// 'url' => 'http://zmzjzyyzx.hactcm.edu.cn/storage/' . $item['srt_path'],
  632. ////// 'size' => 0,
  633. ////// 'language' => 'en',
  634. ////// 'status' => ModelStatusEnum::OK,
  635. ////// ]);
  636. ////// }
  637. //////
  638. ////// Video::query()->updateOrCreate([
  639. ////// 'course_id' => $course->id,
  640. ////// 'course_chapter_id' => $chater->id,
  641. ////// 'title' => $item['video'],
  642. ////// ], [
  643. ////// 'slug' => Str::random(),
  644. ////// 'language' => 'en',
  645. ////// 'url' => $resource->id,
  646. ////// 'published_at' => Carbon::now()->toDateTimeString(),
  647. ////// 'subtitle_zh_path' => $subtitle_resource ? $subtitle_resource->id : '',
  648. ////// 'subtitle_en_path' => $subtitle_resource ? $subtitle_resource->id : '',
  649. ////// 'status' => ModelStatusEnum::OK
  650. ////// ]);
  651. ////// }
  652. //////// Chapter::query()->updateOrCreate([
  653. //////// 'course_id' => $course->id,
  654. //////// 'title' => $section,
  655. //////// 'language' => 'en',
  656. //////// ], [
  657. //////// 'status' => ModelStatusEnum::OK
  658. //////// ]);
  659. ////// }
  660. ////
  661. //// foreach ($courses as $section => $video) {
  662. //// $chater = Chapter::query()->updateOrCreate([
  663. //// 'course_id' => $course->id,
  664. //// 'title' => str_replace('.mp4', '', $video[0]['name']),
  665. //// 'language' => 'en',
  666. //// ], [
  667. //// 'status' => ModelStatusEnum::OK
  668. //// ]);
  669. //// foreach ($video as $item) {
  670. ////
  671. //// $resource = Resource::query()->updateOrCreate([
  672. //// 'name' => $item['name'],
  673. //// 'original_name' => $item['name'],
  674. //// 'path' => $item['path'],
  675. //// ], [
  676. //// 'disk' => 'qiniu',
  677. //// 'url' => 'http://zhongma.qiniu.xmnk.cn/' . $item['path'],
  678. //// 'size' => 0,
  679. //// 'language' => 'en',
  680. //// 'status' => ModelStatusEnum::OK,
  681. //// ]);
  682. //// $subtitle_resource = null;
  683. ////
  684. //// Video::query()->updateOrCreate([
  685. //// 'course_id' => $course->id,
  686. //// 'course_chapter_id' => $chater->id,
  687. //// 'title' => $item['video'],
  688. //// ], [
  689. //// 'slug' => Str::random(),
  690. //// 'language' => 'en',
  691. //// 'url' => $resource->id,
  692. //// 'published_at' => Carbon::now()->toDateTimeString(),
  693. //// 'subtitle_zh_path' => $subtitle_resource ? $subtitle_resource->id : '',
  694. //// 'subtitle_en_path' => $subtitle_resource ? $subtitle_resource->id : '',
  695. //// 'status' => ModelStatusEnum::OK
  696. //// ]);
  697. //// }
  698. //// }
  699. //
  700. // $s_courses = "《中医基础理论》片花.mp4&0 Preface of Learing(序言).mp4&1.1 Breif History of TCM Theory System(中医理论体系简史).mp4&1.2 Wholism Concept(整体观念).mp4&1.3 Treatment Based on Syndrome Differentiation(辨证论治).mp4&2.1 Concept and Theory Contents of Yin-Yang(阴阳概念及阴阳学说内容).mp4&2.2 Application of Yin-Yang Theory in Chinese Medicine(阴阳学说的应用).mp4&2.3 Notion of the Five Elements(五行概念).mp4&2.4 Application of the Five Elements Theory in Chinese Medicine(五行学说的应用).mp4&3.1 Visceral Picture Theory Overview(藏象概述).mp4&3.2 The Heart(心).mp4&3.3 The Lung(肺).mp4&3.4 The Spleen(脾).mp4&3.5 The Liver(肝).mp4&3.6 The Kidney.mp4&3.7 The Six Fu Organs(六腑).mp4&4.1 Qi(气).mp4&4.2 The Blood(血).mp4&4.3 Body Fluid(津液).mp4&4.4 Relationships among Qi, Blood, and Body Fluid(气血津液的相互关系).mp4&5.1 Overview of the Meridian System(经络学说概述).mp4&5.2 The Twelve Meridians(十二经脉).mp4&5.3 The Eight Extraordinary Meridians(奇经八脉).mp4&6.0 Constitution Theory(体质).mp4&7.1 Etiology Introduction(病因概述).mp4&7.10 Improper Diet and Maladjustment of Work and Leisure(饮食失宜及劳逸失度).mp4&7.11 Phlegm and Stagnant Fluid(痰饮).mp4&7.12 Stagnant Blood(瘀血).mp4&7.2 Wind Pathogen(风邪).mp4&7.3 Cold Pathogen(寒邪).mp4&7.4 Summer-heat Pathogen(暑邪).mp4&7.5 Dampness Pathogen(湿邪).mp4&7.6 Dryness Pathogen(燥邪).mp4&7.7 Fire Pathogen(火邪).mp4&7.8 Pestilent Pathogens(疠气).mp4&7.9 Endogenous Seven Affects(内伤七情).mp4&8.1 Basic Pathogenesis I(病机一).mp4&8.2 Basic Pathogenesis II(病机二).mp4&9.1 Principles for Prevention of Disease(预防).mp4&9.2 Principles for Treatment of Disease(治则).mp4";
  701. // $courses = [];
  702. //
  703. // foreach (str2arr($s_courses, '&') as $key => $course) {
  704. //// $courses[$key]['section'] = is_numeric(substr($course, 0, 1)) ? substr($course, 0, 1) : 0;
  705. //// $courses[$key]['path'] = "zhongyijichulilun-20220905/" . $course;
  706. //// $courses[$key]['name'] = $course;
  707. // $item['section'] = is_numeric(substr($course, 0, 1)) ? substr($course, 0, 1) : 0;
  708. // $item['path'] = "zhongyijichulilun-20220905/" . $course;
  709. // $item['name'] = $course;
  710. // $courses[$item['section']][] = $item;
  711. // }
  712. // //创建课程
  713. //// $course = Course::query()->updateOrCreate([
  714. //// 'title' => 'TCM BASIC THEORY',
  715. //// 'language' => 'en',
  716. //// ], [
  717. //// 'status' => ModelStatusEnum::OK
  718. //// ]);
  719. //
  720. // $course = Course::query()->where('id', 3)->first();
  721. //
  722. //
  723. // $chaters = Chapter::query()->where('course_id', $course->id)->orderBy('id')->get()->toArray();
  724. //// $chaters = Chapter::query()->where('course_id', $course->id)->orderBy('id')->delete();
  725. //// Video::query()->where('course_id', $course->id)->delete();
  726. // foreach ($courses as $key => $video) {
  727. //// $chater = Chapter::query()->updateOrCreate([
  728. //// 'course_id' => $course->id,
  729. //// 'title' => str_replace('.mp4', '', $video[0]['name']),
  730. //// 'language' => 'en',
  731. //// ], [
  732. //// 'status' => ModelStatusEnum::OK
  733. //// ]);
  734. // $chater = $chaters[$key];
  735. // foreach ($video as $item) {
  736. // $resource = Resource::query()->updateOrCreate([
  737. // 'name' => $item['name'],
  738. // 'original_name' => $item['name'],
  739. // 'path' => $item['path'],
  740. // ], [
  741. // 'disk' => 'qiniu',
  742. // 'url' => 'http://zhongma.qiniu.xmnk.cn/' . $item['path'],
  743. // 'size' => 0,
  744. // 'language' => 'en',
  745. //// 'language' => 'zh_CN',
  746. // 'status' => ModelStatusEnum::OK,
  747. // ]);
  748. // $subtitle_resource = null;
  749. //
  750. // Video::query()->updateOrCreate([
  751. // 'course_id' => $course->id,
  752. // 'course_chapter_id' => $chater['id'],
  753. // 'title' => $item['name'],
  754. // ], [
  755. // 'slug' => Str::random(),
  756. // 'language' => 'en',
  757. //// 'language' => 'zh_CN',
  758. // 'url' => $resource->id,
  759. // 'published_at' => Carbon::now()->toDateTimeString(),
  760. // 'subtitle_zh_path' => $subtitle_resource ? $subtitle_resource->id : '',
  761. // 'subtitle_en_path' => $subtitle_resource ? $subtitle_resource->id : '',
  762. // 'status' => ModelStatusEnum::OK
  763. // ]);
  764. // }
  765. // }
  766. //
  767. // }
  768. public function urlMove()
  769. {
  770. $course_id = 1;
  771. $videos = Video::query()->where('course_id', $course_id)->where('status', ModelStatusEnum::OK)->pluck('url');
  772. foreach ($videos as $url) {
  773. $resource = Resource::query()->find($url);
  774. $this->line($url);
  775. $resource->disk = 'qiniu';
  776. $resource->path = str_replace('course_video/', '', $resource->path);
  777. $resource->url = 'http://zhongma.qiniu.xmnk.cn/' . $resource->path;
  778. $resource->save();
  779. }
  780. $this->line('ok');
  781. }
  782. }